lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Solr Wiki] Update of "FieldCollapsing" by YonikSeeley
Date Wed, 24 Nov 2010 20:48:22 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "FieldCollapsing" page has been changed by YonikSeeley.
The comment on this change is: doc group.main, group.format.


  From the response above, we can see that 5 documents matched our base query of "memory".
 Of those, 1 had a price below $100, 3 had a price above $100.  This does not add up to 5
because one document was missing a price and hence did not match either group.query.
+ We can optionally use the results of a group command as the "main" result (i.e. a single
flat document list that would normally be produced by a non-grouped query request) by adding
the parameter '''group.main=true'''.  Although this result format does not have as much information,
it may be easier for existing solr clients to parse.
+ [[http://localhost:8983/solr/select?wt=json&indent=true&fl=id,name,manufacturer&q=solr+memory&group=true&group.field=manu_exact&group.main=true|...&q=solr+memory&group=true&group.field=manu_exact&group.main=true]]
+ {{{
+   "response":{"numFound":6,"start":0,"docs":[
+       {
+         "id":"SOLR1000",
+         "name":"Solr, the Enterprise Search Server",
+         "manu":"Apache Software Foundation"},
+       {
+         "id":"VS1GB400C3",
+         "name":"CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System
Memory - Retail",
+         "manu":"Corsair Microsystems Inc."},
+       {
+         "id":"VDBDB1A16",
+         "name":"A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System
Memory - OEM",
+         "manu":"A-DATA Technology Inc."},
+       {
+         "id":"0579B002",
+         "name":"Canon PIXMA MP500 All-In-One Photo Printer",
+         "manu":"Canon Inc."},
+       {
+         "id":"EN7800GTX/2DHTV/256M",
+         "name":"ASUS Extreme N7800GTX/2DHTV (256 MB)",
+         "manu":"ASUS Computer Inc."}]
+   }
+ }}}
  = Request Parameters =
  ||'''param name''' ||'''param value'''||'''description''' ||
@@ -111, +142 @@

  ||group.offset||[number]||The offset into the document list of each group.||
  ||sort||[sortspec]||How to sort the groups relative to each other.  For example, {{{sort=popularity
desc}}} will cause the groups to be sorted according to the highest popularity doc in each
group.  Defaults to "score desc".||
  ||group.sort||[sortspec]||How to sort documents within a single group.  Defaults to the
same value as the {{{sort}}} parameter.  NOTE: group.sort is not currently supported||
+ ||group.format||grouped/simple||if simple, the grouped documents are presented in a single
flat list.  The start and rows parameters refer to numbers of documents instead of numbers
of groups.||
+ ||group.main||true/false||If true, the result of the first facet grouping command is used
as the main result list in the response, using group.format=simple||
   * Any number of group commands (group.field, group.func, group.query) may be specified
in a single request.
@@ -118, +152 @@

  = Known Limitations =
   * Distributed search support for result grouping has not yet been implemented.
-  * Support for missing values (groupValue=null) has not yet been implemented.
   * Support for grouping on a multi-valued field has not yet been implemented.
   * Support for faceting after collapsing has not been implemented (faceting works like normal,
with grouping having no effect)
   * Further performance improvements are planned soon!

View raw message