Return-Path: X-Original-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE74292AB for ; Wed, 16 Nov 2011 16:53:27 +0000 (UTC) Received: (qmail 9992 invoked by uid 500); 16 Nov 2011 16:53:27 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 9958 invoked by uid 500); 16 Nov 2011 16:53:26 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 9951 invoked by uid 99); 16 Nov 2011 16:53:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 16:53:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 16:53:20 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 8A482892; Wed, 16 Nov 2011 16:52:58 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Wed, 16 Nov 2011 16:52:58 -0000 Message-ID: <20111116165258.3475.36307@eos.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Update_of_=22SimpleFacetParameters=22_by_PaulBo?= =?utf-8?q?rgermans?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for chan= ge notification. The "SimpleFacetParameters" page has been changed by PaulBorgermans: http://wiki.apache.org/solr/SimpleFacetParameters?action=3Ddiff&rev1=3D60&r= ev2=3D61 = For More information on General Issues involved with Faceted searches in = Solr, please read the SolrFacetingOverview. = - = <> = =3D Parameters =3D - = These are the parameters used to drive the Simple Faceting behavior, grou= ped by the type of faceting they support. = Note that many parameters may be overridden on a per-field basis with the= following syntax: = - `f..=3D` + . `f..=3D` = - eg. = + eg. + = {{{ facet.limit=3D10 f.category.facet.limit=3D5 @@ -23, +22 @@ Indicating that 10 terms will be returned for all specified facet.fields,= excepting category. Which if specified will return 5 terms. = =3D=3D facet =3D=3D - = Set to "true" this param enables facet counts in the query response. Any = blank or missing value, or "false" will disable faceting. None of the othe= r parameters listed below will have any effect without setting this param t= o "true" = The default value is blank. = - =3D=3D facet.query : Arbitrary Query Faceting =3D=3D + =3D=3D facet.query : Arbitrary Query Faceting =3D=3D - = - This param allows you to specify an arbitrary query in the Lucene default= syntax to generate a facet count. By default, faceting returns a count of = the unique terms for a "field", while facet.query allows you to determine c= ounts for arbitrary terms or expressions. = + This param allows you to specify an arbitrary query in the Lucene default= syntax to generate a facet count. By default, faceting returns a count of = the unique terms for a "field", while facet.query allows you to determine c= ounts for arbitrary terms or expressions. = This parameter can be specified multiple times to indicate that multiple = queries should be used as separate facet constraints. It can be particular= ly useful for numeric range based facets, or prefix based facets -- see exa= mple below (i.e. {{{price:[* TO 500] and price:[501 TO *]}}}). = - To specify facet queries not in the Lucene default query syntax, prefix t= he facet query with the name of the query notation, a la [[LocalParams]]. F= or example, to use the hypothetical myfunc query parser, send parameter {{{= facet.query=3D{!myfunc}name~fred}}} + To specify facet queries not in the Lucene default query syntax, prefix t= he facet query with the name of the query notation, a la LocalParams. For e= xample, to use the hypothetical myfunc query parser, send parameter {{{face= t.query=3D{!myfunc}name~fred}}} = =3D=3D Field Value Faceting Parameters =3D=3D - = Several params can be used to trigger faceting based on the indexed Terms= of a field. = When using this param, it is important to remember that "Term" is a very = specific concept in Lucene -- it relates to the literal field/value pairs t= hat are ''Indexed'' after any Analysis occurs. For text fields that includ= e stemming, or lowercasing, or word splitting you may not get what you expe= ct. If you want both Analysis (for searching) and Faceting on the full lit= eral Strings, use copyField to create two versions of the field: one Text a= nd one String. Make sure both are `indexed=3D"true"` = <> + = =3D=3D=3D facet.field =3D=3D=3D - = This param allows you to specify a field which should be treated as a fac= et. It will iterate over each Term in the field and generate a facet count= using that Term as the constraint. = This parameter can be specified multiple times to indicate multiple facet= fields. @@ -52, +48 @@ None of the other params in this section will have any effect without spe= cifying at least one field name using this param. = =3D=3D=3D facet.prefix =3D=3D=3D - = Limits the terms on which to facet to those starting with the given strin= g prefix. Note that unlike fq, this does not change the search results -- = it merely reduces the facet values returned to those beginning with the spe= cified prefix. = This parameter can be specified on a per field basis. @@ -60, +55 @@ [[Solr1.2]] = =3D=3D=3D facet.sort =3D=3D=3D - = This param determines the ordering of the facet field constraints. = - * {{{count}}} - sort the constraints by count (highest count first) + * {{{count}}} - sort the constraints by count (highest count first) - * {{{index}}} - to return the constraints sorted in their index order = (lexicographic by indexed term). For terms in the ascii range, this will b= e alphabetically sorted. + * {{{index}}} - to return the constraints sorted in their index order (l= exicographic by indexed term). For terms in the ascii range, this will be = alphabetically sorted. = The default is {{{count}}} if facet.limit is greater than 0, {{{index}}} = otherwise. = @@ -73, +67 @@ This parameter can be specified on a per field basis. = =3D=3D=3D facet.limit =3D=3D=3D - = - This param indicates the maximum number of constraint counts that should = be returned for the facet fields. = + This param indicates the maximum number of constraint counts that should = be returned for the facet fields. A negative value means unlimited. - A negative value means unlimited. = The default value is 100. = This parameter can be specified on a per field basis to indicate a separa= te limit for certain fields. = =3D=3D=3D facet.offset =3D=3D=3D - = This param indicates an offset into the list of constraints to allow pagi= ng. = The default value is 0. @@ -92, +83 @@ [[Solr1.2]] = =3D=3D=3D facet.mincount =3D=3D=3D - = This param indicates the minimum counts for facet fields should be includ= ed in the response. = The default value is 0. @@ -102, +92 @@ [[Solr1.2]] = =3D=3D=3D facet.missing =3D=3D=3D - = Set to "true" this param indicates that in addition to the Term based con= straints of a facet field, a count of all matching results which have no va= lue for the field should be computed = The default value is false. @@ -110, +99 @@ This parameter can be specified on a per field basis. = <> + = =3D=3D=3D facet.method =3D=3D=3D - = This parameter indicates what type of algorithm/method to use when faceti= ng a field. = - * {{{enum}}} Enumerates all terms in a field, calculating the set inte= rsection of documents that match the term with documents that match the que= ry. This was the default (and only) method for faceting multi-valued field= s prior to Solr 1.4. = + * {{{enum}}} Enumerates all terms in a field, calculating the set inters= ection of documents that match the term with documents that match the query= . This was the default (and only) method for faceting multi-valued fields = prior to Solr 1.4. - * {{{fc}}} (stands for field cache) The facet counts are calculated by= iterating over documents that match the query and summing the terms that a= ppear in each document. This was the default method for single valued fiel= ds prior to Solr 1.4. + * {{{fc}}} (stands for field cache) The facet counts are calculated by i= terating over documents that match the query and summing the terms that app= ear in each document. This was the default method for single valued fields= prior to Solr 1.4. = - The default value is {{{fc}}} (except for !BoolField) since it tends to u= se less memory and is faster when a field has many unique terms in the inde= x. = + The default value is {{{fc}}} (except for !BoolField) since it tends to u= se less memory and is faster when a field has many unique terms in the inde= x. = This parameter can be specified on a per field basis. = [[Solr1.4]] = =3D=3D=3D facet.enum.cache.minDf =3D=3D=3D - = - This param indicates the minimum document frequency (number of documents = matching a term) for which the filterCache should be used when determining = the constraint count for that term. This is only used when {{{facet.method= =3Denum}}} method of faceting = + This param indicates the minimum document frequency (number of documents = matching a term) for which the filterCache should be used when determining = the constraint count for that term. This is only used when {{{facet.method= =3Denum}}} method of faceting = + A value greater than zero will decrease memory usage of the filterCache, = but increase the query time. When faceting on a field with a very large num= ber of terms, and you wish to decrease memory usage, try a low value of 25 = to 50 first. - A value greater than zero will decrease memory usage of the filterCache, = but increase the query time. - When faceting on a field with a very large number of terms, and you wish = to decrease memory usage, try a low value of 25 to 50 first. = The default value is 0, causing the filterCache to be used for all terms = in the field. = @@ -137, +124 @@ [[Solr1.2]] = =3D=3D Date Faceting Parameters =3D=3D - = - [[Solr1.3]] - Several params can be used to trigger faceting based on Date ranges compu= ted using simple [[http://lucene.apache.org/solr/api/org/apache/solr/util/D= ateMathParser.html|DateMathParser]] expressions. + [[Solr1.3]] Several params can be used to trigger faceting based on D= ate ranges computed using simple [[http://lucene.apache.org/solr/api/org/ap= ache/solr/util/DateMathParser.html|DateMathParser]] expressions. = When using Date Faceting, the {{{facet.date}}}, {{{facet.date.start}}}, {= {{facet.date.end}}}, and {{{facet.date.gap}}} params are all mandatory... = {X} '''NOTE:''' as of [[Solr3.1]] Date Faceting has been deprecated in fa= vor of the more general [[#rangefaceting|Range Faceting described below]]. = The response structure is slightly differnet, but the funtionality is equi= vilent (except that it supports numeric fields as well as dates) = =3D=3D=3D facet.date =3D=3D=3D - = This param allows you to specify names of fields (of type DateField) whic= h should be treated as date facets. = This parameter can be specified multiple times to indicate multiple date = facet fields. = =3D=3D=3D facet.date.start =3D=3D=3D - = The lower bound for the first date range for all Date Faceting on this fi= eld. This should be a single date expression which may use the [[http://lu= cene.apache.org/solr/api/org/apache/solr/util/DateMathParser.html|DateMathP= arser]] syntax. = This parameter can be specified on a per field basis. = =3D=3D=3D facet.date.end =3D=3D=3D - = The minimum upper bound for the last date range for all Date Faceting on = this field (see {{{facet.date.hardend}}} for an explanation of what the act= ual end value may be greater). This should be a single date expression whi= ch may use the [[http://lucene.apache.org/solr/api/org/apache/solr/util/Dat= eMathParser.html|DateMathParser]] syntax. = This parameter can be specified on a per field basis. = =3D=3D=3D facet.date.gap =3D=3D=3D - = The size of each date range expressed as an interval to be added to the l= ower bound using the [[http://lucene.apache.org/solr/api/org/apache/solr/ut= il/DateMathParser.html|DateMathParser]] syntax. = Example: {{{facet.date.gap=3D%2B1DAY}}} (+1DAY) = This parameter can be specified on a per field basis. = - [[Solr3.2]], [[Solr4.0]] -- See https://issues.apache.org/jira/browse= /SOLR-2366 - The following section on variable width gaps discusses uncommitted code - Gaps can also be variable width by passing in a comma separated list of t= he gap size to be used. The last gap specified will be used to fill out al= l remaining gaps if the number of gaps given does not go evenly into the ra= nge. Variable width gaps are useful, for example, in spatial applications = where one might want to facet by distance into three buckets: walking (0-5K= M), driving(5-100KM), other(100KM+). + [[Solr3.5]], [[Solr4.0]] -- See https://issues.apache.org/jira/browse= /SOLR-2366 The following section on variable width gaps discusses uncommitt= ed code Gaps can also be variable width by passing in a comma separated lis= t of the gap size to be used. The last gap specified will be used to fill = out all remaining gaps if the number of gaps given does not go evenly into = the range. Variable width gaps are useful, for example, in spatial applica= tions where one might want to facet by distance into three buckets: walking= (0-5KM), driving(5-100KM), other(100KM+). = Example: {{{facet.date.gap=3D+1DAY,+2DAY,+3DAY,+10DAY}}} -- This creates = 4+ buckets of size, 1 day, 2 days, 3 days and then 0 or more of 10 days eac= h, depending on the start and end times. = =3D=3D=3D facet.date.hardend =3D=3D=3D - = A Boolean parameter instructing Solr what to do in the event that {{{face= t.date.gap}}} does not divide evenly between {{{facet.date.start}}} and {{{= facet.date.end}}}. If this is true, the last date range constraint will ha= ve an upper bound of {{{facet.date.end}}}; if false, the last date range wi= ll have the smallest possible upper bound greater then {{{facet.date.end}}}= such that the range is exactly {{{facet.date.gap}}} wide. = The default is false. @@ -186, +164 @@ This parameter can be specified on a per field basis. = =3D=3D=3D facet.date.other =3D=3D=3D - = This param indicates that in addition to the counts for each date range c= onstraint between {{{facet.date.start}}} and {{{facet.date.end}}}, counts s= hould also be computed for... = - * {{{before}}} all records with field values lower then lower bound of= the first range + * {{{before}}} all records with field values lower then lower bound of t= he first range - * {{{after}}} all records with field values greater then the upper bou= nd of the last range + * {{{after}}} all records with field values greater then the upper bound= of the last range - * {{{between}}} all records with field values between the start and en= d bounds of all ranges + * {{{between}}} all records with field values between the start and end = bounds of all ranges - * {{{none}}} compute none of this information + * {{{none}}} compute none of this information - * {{{all}}} shortcut for {{{before}}}, {{{between}}}, and {{{after}}} + * {{{all}}} shortcut for {{{before}}}, {{{between}}}, and {{{after}}} = This parameter can be specified on a per field basis. = In addition to the {{{all}}} option, this parameter can be specified mult= iple times to indicate multiple choices -- but {{{none}}} will override all= other options. = =3D=3D=3D facet.date.include =3D=3D=3D - = [[Solr3.1]] = By default, the ranges used to compute date faceting between facet.date.s= tart and facet.date.end are all inclusive of both endpoints, while the the = "before" and "after" ranges are not inclusive. This behavior can be modifi= ed by the {{{facet.date.include}}} param, which can be any combination of t= he following options... = - * {{{lower}}} =3D all gap based ranges include their lower bound + * {{{lower}}} =3D all gap based ranges include their lower bound - * {{{upper}}} =3D all gap based ranges include their upper bound + * {{{upper}}} =3D all gap based ranges include their upper bound - * {{{edge}}} =3D the first and last gap ranges include their edge boun= ds (ie: lower for the first one, upper for the last one) even if the corres= ponding upper/lower option is not specified + * {{{edge}}} =3D the first and last gap ranges include their edge bounds= (ie: lower for the first one, upper for the last one) even if the correspo= nding upper/lower option is not specified - * {{{outer}}} =3D the "before" and "after" ranges will be inclusive of= their bounds, even if the first or last ranges already include those bound= aries. + * {{{outer}}} =3D the "before" and "after" ranges will be inclusive of t= heir bounds, even if the first or last ranges already include those boundar= ies. - * {{{all}}} =3D shorthand for lower, upper, edge, outer + * {{{all}}} =3D shorthand for lower, upper, edge, outer = This parameter can be specified on a per field basis. = This parameter can be specified multiple times to indicate multiple choic= es. = <> + = =3D=3D Facet by Range =3D=3D - = [[Solr3.1]] = As a generalization of the Date faceting described above, one can use the= Range Faceting feature on any date field or any numeric field that support= s range queries. This is particularly useful for the cases in the past whe= re one might stitch together a series of range queries (as facet by query) = for things like prices, etc. = =3D=3D=3D facet.range =3D=3D=3D - = This param indicates what field to create range facets for. This param a= llows you to specify names of fields which should be treated as range face= ts. = Example: {{{facet.range=3Dprice&facet.range=3Dage}}} = =3D=3D=3D facet.range.start =3D=3D=3D - = The lower bound of the ranges. = This parameter can be specified on a per field basis. @@ -237, +211 @@ Example: {{{f.price.facet.range.start=3D0.0&f.age.facet.range.start=3D10}= }} = =3D=3D=3D facet.range.end =3D=3D=3D - = The upper bound of the ranges. = This parameter can be specified on a per field basis. @@ -245, +218 @@ Example: {{{f.price.facet.range.end=3D1000.0&f.age.facet.range.start=3D99= }}} = =3D=3D=3D facet.range.gap =3D=3D=3D - = The size of each range expressed as a value to be added to the lower boun= d. For date fields, this should be expressed using the [[http://lucene.apa= che.org/solr/api/org/apache/solr/util/DateMathParser.html|DateMathParser]] = syntax. (ie: {{{facet.range.gap=3D%2B1DAY}}} ... '+1DAY') = This parameter can be specified on a per field basis. = Example: {{{f.price.facet.range.gap=3D100&f.age.facet.range.gap=3D10}}} = - [[Solr3.2]], [[Solr4.0]] -- See https://issues.apache.org/jira/browse= /SOLR-2366 - The following section on variable width gaps discusses uncommitted code - Gaps can also be variable width by passing in a comma separated list of t= he gap size to be used. The last gap specified will be used to fill out al= l remaining gaps if the number of gaps given does not go evenly into the ra= nge. Variable width gaps are useful, for example, in spatial applications = where one might want to facet by distance into three buckets: walking (0-5K= M), driving(5-100KM), other(100KM+). + [[Solr3.5]], [[Solr4.0]] -- See https://issues.apache.org/jira/browse= /SOLR-2366 The following section on variable width gaps discusses uncommitt= ed code Gaps can also be variable width by passing in a comma separated lis= t of the gap size to be used. The last gap specified will be used to fill = out all remaining gaps if the number of gaps given does not go evenly into = the range. Variable width gaps are useful, for example, in spatial applica= tions where one might want to facet by distance into three buckets: walking= (0-5KM), driving(5-100KM), other(100KM+). = Example: {{{facet.date.gap=3D1,2,3,10}}} -- This creates 4+ buckets of si= ze, 1, 2, 3 and then 0 or more buckets of 10 days each, depending on the st= art and end values. = =3D=3D=3D facet.range.hardend =3D=3D=3D - = A Boolean parameter instructing Solr what to do in the event that {{{face= t.range.gap}}} does not divide evenly between {{{facet.range.start}}} and {= {{facet.range.end}}}. If this is true, the last range constraint will have= an upper bound of {{{facet.range.end}}}; if false, the last range will hav= e the smallest possible upper bound greater then {{{facet.range.end}}} such= that the range is exactly {{{facet.range.gap}}} wide. = The default is false. @@ -267, +236 @@ This parameter can be specified on a per field basis. = =3D=3D=3D facet.range.other =3D=3D=3D - = This param indicates that in addition to the counts for each range constr= aint between {{{facet.range.start}}} and {{{facet.range.end}}}, counts shou= ld also be computed for... = - * {{{before}}} all records with field values lower then lower bound of= the first range + * {{{before}}} all records with field values lower then lower bound of t= he first range - * {{{after}}} all records with field values greater then the upper bou= nd of the last range + * {{{after}}} all records with field values greater then the upper bound= of the last range - * {{{between}}} all records with field values between the start and en= d bounds of all ranges + * {{{between}}} all records with field values between the start and end = bounds of all ranges - * {{{none}}} compute none of this information + * {{{none}}} compute none of this information - * {{{all}}} shortcut for {{{before}}}, {{{between}}}, and {{{after}}} + * {{{all}}} shortcut for {{{before}}}, {{{between}}}, and {{{after}}} = This parameter can be specified on a per field basis. = In addition to the {{{all}}} option, this parameter can be specified mult= iple times to indicate multiple choices -- but {{{none}}} will override all= other options. = - = =3D=3D=3D facet.range.include =3D=3D=3D - = By default, the ranges used to compute range faceting between facet.range= .start and facet.range.end are inclusive of their lower bounds and exclusiv= e of the upper bounds. The "before" range is exclusive and the "after" rang= e is inclusive. This default, equivalent to {{{lower}}} below, will ''not''= result in double counting at the boundaries. This behavior can be modified= by the {{{facet.range.include}}} param, which can be any combination of th= e following options... = - * {{{lower}}} =3D all gap based ranges include their lower bound + * {{{lower}}} =3D all gap based ranges include their lower bound - * {{{upper}}} =3D all gap based ranges include their upper bound + * {{{upper}}} =3D all gap based ranges include their upper bound - * {{{edge}}} =3D the first and last gap ranges include their edge boun= ds (ie: lower for the first one, upper for the last one) even if the corres= ponding upper/lower option is not specified + * {{{edge}}} =3D the first and last gap ranges include their edge bounds= (ie: lower for the first one, upper for the last one) even if the correspo= nding upper/lower option is not specified - * {{{outer}}} =3D the "before" and "after" ranges will be inclusive of= their bounds, even if the first or last ranges already include those bound= aries. + * {{{outer}}} =3D the "before" and "after" ranges will be inclusive of t= heir bounds, even if the first or last ranges already include those boundar= ies. - * {{{all}}} =3D shorthand for lower, upper, edge, outer + * {{{all}}} =3D shorthand for lower, upper, edge, outer = This parameter can be specified on a per field basis. = @@ -298, +264 @@ If you want to ensure you don't double-count, don't choose both lower & u= pper, don't choose outer, and don't choose all. = =3D=3D Multi-Select Faceting and LocalParams =3D=3D - [[Solr1.4]] - The LocalParams syntax provides a method of adding meta-data to other par= ameter values, much like XML attributes. + [[Solr1.4]] The LocalParams syntax provides a method of adding meta-d= ata to other parameter values, much like XML attributes. = =3D=3D=3D Tagging and excluding Filters =3D=3D=3D One can tag specific filters and exclude those filters when faceting. Th= is is generally needed when doing multi-select faceting. = Consider the following example query with faceting: + = {{{ q=3Dmainquery&fq=3Dstatus:public&fq=3Ddoctype:pdf&facet=3Don&facet.field= =3Ddoctype }}} - = - = Because everything is already constrained by the filter {{{doctype:pdf}}}= , the {{{facet.field=3Ddoctype}}} facet command is currently redundant and = will return 0 counts for everything except {{{doctype:pdf}}}. = To implement a multi-select facet for doctype, a GUI may want to still di= splay the other doctype values and their associated counts, as if the {{{do= ctype:pdf}}} constraint had not yet been applied. Example: @@ -321, +285 @@ [ ] Excel(11) [ ] HTML (63) }}} - = To return counts for doctype values that are currently not selected, tag = filters that directly constrain doctype, and exclude those filters when fac= eting on doctype. = {{{ q=3Dmainquery&fq=3Dstatus:public&fq=3D{!tag=3Ddt}doctype:pdf&facet=3Don&f= acet.field=3D{!ex=3Ddt}doctype }}} - = - Filter exclusion is supported for all types of facets. - Both the {{{tag}}} and {{{ex}}} local params may specify multiple values = by separating them with commas. + Filter exclusion is supported for all types of facets. Both the {{{tag}}}= and {{{ex}}} local params may specify multiple values by separating them w= ith commas. = [[Solr3.1]] Starting with Solr 3.1, the primary relevance query (i.e.= the one normally specified by the '''q''' parameter) may also be excluded. = =3D=3D=3D key : Changing the output key =3D=3D=3D - To change the output key for a faceting command, specify a new name via t= he {{{key}}} local param. + To change the output key for a faceting command, specify a new name via t= he {{{key}}} local param. For example, - For example, = + = {{{ facet.field=3D{!ex=3Ddt key=3Dmylabel}doctype }}} Will cause the results to be returned under the key "mylabel" rather than= "doctype" in the response. This can be helpful when faceting on the same f= ield multiple times with different exclusions. = - = - = =3D=3D Pivot (ie Decision Tree) Faceting =3D=3D - [[Solr4.0]] - Pivot faceting allows you to facet within the results of the parent facet + [[Solr4.0]] Pivot faceting allows you to facet within the results of = the parent facet = =3D=3D=3D facet.pivot =3D=3D=3D A list of fields to pivot. Multiple values will create multiple sections= in the response + = {{{ &facet.pivot=3Dcat,popularity,inStock&facet.pivot=3Dpopularity,cat }}} - = =3D=3D=3D facet.pivot.mincount =3D=3D=3D The minimum number of documents that need to match for the result to show= up in the results. Default value is 1 = - = =3D Deprecated Parameters =3D - = =3D=3D facet.zeros =3D=3D - = Set to "true" this param indicates that constraint counts for facet field= s should be included even if the count is "0", set to "false" or blank and = the "0" counts will be suppressed to save on the amount of data returned in= the response. = The default value is "true". @@ -370, +325 @@ Use facet.mincount instead. = =3D Examples =3D - = '''Note:''' In many of these examples "rows" is set to 0 so that the main= result set is empty, to better emphasize the facet data. = =3D=3D Facet Fields =3D=3D - = `http://localhost:8983/solr/select?q=3Dipod&rows=3D0&facet=3Dtrue&facet.l= imit=3D-1&facet.field=3Dcat&facet.field=3DinStock` = {{{ @@ -385, +338 @@ - 0 + 0 - 0 + 0 - 0 + 0 - 0 + 0 - 1 + 1 - 0 + 0 - 3 + 3 - 0 + 0 - 0 + 0 - 0 + 0 - 2 + 2 - 0 + 0 - 0 + 0 - 0 + 0 - 0 + 0 - 0 + 0 - 3 + 3 - 1 + 1 }}} - = =3D=3D Facet Fields with No Zeros =3D=3D - = `http://localhost:8983/solr/select?q=3Dipod&rows=3D0&facet=3Dtrue&facet.l= imit=3D-1&facet.field=3Dcat&facet.mincount=3D1&facet.field=3DinStock` = {{{ @@ -423, +374 @@ - 1 + 1 - 2 + 2 - 3 + 3 - 3 + 3 - 1 + 1 }}} - = - = =3D=3D Facet Fields with No Zeros And Missing Count For One Field =3D=3D - = `http://localhost:8983/solr/select?q=3Dipod&rows=3D0&facet=3Dtrue&facet.l= imit=3D-1&facet.field=3Dcat&f.cat.facet.missing=3Dtrue&facet.mincount=3D1&f= acet.field=3DinStock` = {{{ @@ -449, +397 @@ - 1 + 1 - 2 + 2 - 3 + 3 1 - 3 + 3 - 1 + 1 }}} - = - = =3D=3D Facet Field with Limit =3D=3D - = `http://localhost:8983/solr/select?rows=3D0&q=3DinStock:true&facet=3Dtrue= &facet.field=3Dcat&facet.limit=3D5` = {{{ @@ -476, +421 @@ - 10 + 10 - 3 + 3 - 2 + 2 - 2 + 2 - 2 + 2 }}} - = =3D=3D Facet Fields and Facet Queries =3D=3D - = `http://localhost:8983/solr/select?q=3Dvideo&rows=3D0&facet=3Dtrue&facet.= field=3DinStock&facet.query=3Dprice:[*+TO+500]&facet.query=3Dprice:[500+TO+= *]` = {{{ @@ -502, +445 @@ - 2 + 2 - 1 + 1 }}} - = =3D=3D Facet prefix (term suggest) =3D=3D `http://localhost:8983/solr/select?q=3Dhatcher&wt=3Druby&indent=3Don&face= t=3Don&rows=3D0&facet.field=3Dtext&facet.prefix=3Dxx&facet.limit=3D5&facet.= mincount=3D1` = @@ -519, +461 @@ 'status'=3D>0, 'QTime'=3D>88, 'params'=3D>{ - 'facet.limit'=3D>'5', + 'facet.limit'=3D>'5', - 'wt'=3D>'ruby', - 'rows'=3D>'0', + 'wt'=3D>'ruby', + 'rows'=3D>'0', - 'facet'=3D>'on', + 'facet'=3D>'on', - 'facet.mincount'=3D>'1', + 'facet.mincount'=3D>'1', - 'facet.field'=3D>'text', + 'facet.field'=3D>'text', - 'indent'=3D>'on', + 'indent'=3D>'on', - 'facet.prefix'=3D>'xx', + 'facet.prefix'=3D>'xx', - 'q'=3D>'hatcher'}}, + 'q'=3D>'hatcher'}}, 'response'=3D>{'numFound'=3D>90,'start'=3D>0,'docs'=3D>[] }, 'facet_counts'=3D>{ 'facet_queries'=3D>{}, 'facet_fields'=3D>{ - 'text'=3D>[ - 'xx',7, - 'xxxviii',2, + 'text'=3D>[ + 'xx',7, + 'xxxviii',2, - 'xx909337',1, + 'xx909337',1, - 'xxvi',1] } } } + 'xxvi',1] } } } }}} - = - = =3D=3D Date Faceting: per day for the past 5 days =3D=3D - = [[Solr1.3]] = `http://localhost:8983/solr/select/?q=3D*:*&rows=3D0&facet=3Dtrue&facet.d= ate=3Dtimestamp&facet.date.start=3DNOW/DAY-5DAYS&facet.date.end=3DNOW/DAY%2= B1DAY&facet.date.gap=3D%2B1DAY` @@ -582, +521 @@ }}} - = - = =3D=3D Retrieve docs with facets missing =3D=3D - = All the docs counted by facet.missing can be retrieved using a query filt= er: `fq=3D-facetField:[* TO *]` - = = =3D=3D Pivot (ie Decision Tree) Faceting =3D=3D [[Solr4.0]] = `http://localhost:8983/solr/select?q=3D*:*&facet.pivot=3Dcat,popularity,i= nStock&facet.pivot=3Dpopularity,cat&facet=3Dtrue&facet.field=3Dcat&facet.li= mit=3D5&rows=3D0&wt=3Djson&indent=3Dtrue&facet.pivot.mincount=3D0` + = {{{ "facet_pivot":{ "cat,popularity,inStock":[{ @@ -622, +558 @@ { ... }}} - = - = =3D Warming =3D + facet.field queries using the term enumeration method can avoid the evalu= ation of some terms for greater efficiency. To force the evaluation of all = terms for warming, the base query should match a single document. = - facet.field queries using the term enumeration method can avoid the evalu= ation of some terms for greater efficiency. - To force the evaluation of all terms for warming, the base query should m= atch a single document. -=20