You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by "Hoss Man (Confluence)" <co...@apache.org> on 2013/09/12 00:42:00 UTC
[CONF] Apache Solr Reference Guide > Faceting
Space: Apache Solr Reference Guide (https://cwiki.apache.org/confluence/display/solr)
Page: Faceting (https://cwiki.apache.org/confluence/display/solr/Faceting)
Change Comment:
---------------------------------------------------------------------
SOLR-2548 facet.threads
Edited by Hoss Man:
---------------------------------------------------------------------
{section}
{column:width=75%}
As described in the section [Overview of Searching in Solr], faceting is the arrangement of search results into categories based on indexed terms. Searchers are presented with the indexed terms, along with numerical counts of how many matching documents were found were each term. Faceting makes it easy for users to explore search results, narrowing in on exactly the results they are looking for.
{column}
{column:width=25%}
{panel}
Topics covered on this page:
{toc:maxLevel=2}
{panel}
{column}
{section}
h2. General Parameters
The table below summarizes the general parameters for controlling faceting.
|| Parameter || Description ||
| [facet|#The {{facet}} Parameter] | If set to true, enables faceting. |
| [facet.query|#The {{facet.query}} Parameter] | Specifies a Lucene query to generate a facet count. |
These parameters are described in the sections below.
h3. The {{facet}} Parameter
If set to "true," this parameter enables facet counts in the query response. If set to "false" to a blank or missing value, this parameter disables faceting. None of the other parameters listed below will have any effect unless this parameter is set to "true." The default value is blank.
h3. The {{facet.query}} Parameter
This parameter allows you to specify an arbitrary query in the Lucene default syntax to generate a facet count. By default, Solr's faceting feature automatically determines the unique terms for a field and returns a count for each of those terms. Using {{facet.query}}, you can override this default behavior and select exactly which terms or expressions you would like to see counted. In a typical implementation of faceting, you will specify a number of {{facet.query}} parameters. This parameter can be particularly useful for numeric-range-based facets or prefix-based facets.
You can set the {{facet.query}} parameter multiple times to indicate that multiple queries should be used as separate facet constraints.
To use facet queries in a syntax other than the default syntax, prefix the facet query with the name of the query notation. For example, to use the hypothetical {{myfunc}} query parser, you could set the {{facet.query}} parameter like so:
{{facet.query=\{\!myfunc\}name~fred}}
h2. Field-Value Faceting Parameters
Several parameters can be used to trigger faceting based on the indexed terms in a field.
When using this parameter, it is important to remember that "term" is a very specific concept in Lucene: it relates to the literal field/value pairs that are indexed after any analysis occurs. For text fields that include stemming, lowercasing, or word splitting, the resulting terms may not be what you expect. If you want Solr to perform both analysis (for searching) and faceting on the full literal strings, use the {{copyField}} directive in the {{schema.xml}} file to create two versions of the field: one Text and one String. Make sure both are {{indexed="true"}}. (For more information about the {{copyField}} directive, see [Documents, Fields, and Schema Design].)
The table below summarizes Solr's field value faceting parameters.
|| Parameter || Description ||
| [facet.field|#The {{facet.field}} Parameter] | Identifies a field to be treated as a facet. |
| [facet.prefix|#The {{facet.prefix}} Parameter] | Limits the terms used for faceting to those that begin with the specified prefix. |
| [facet.sort|#The {{facet.sort}} Parameter] | Controls how faceted results are sorted. |
| [facet.limit|#The {{facet.limit}} Parameter] | Controls how many constraints should be returned for each facet. |
| [facet.offset|#The {{facet.offset}} Parameter] | Specifies an offset into the facet results at which to begin displaying facets. |
| [facet.mincount|#The {{facet.mincount}} Parameter] | Specifies the minimum counts required for a facet field to be included in the response. |
| [facet.missing|#The {{facet.missing}} Parameter] | Controls whether Solr should compute a count of all matching results which have no value for the field, in addition to the term-based constraints of a facet field. |
| [facet.method|#The {{facet.method}} Parameter] | Selects the algorithm or method Solr should use when faceting a field. |
| [facet.enum.cache.minDF|#The {{facet.enum.cache.minDF}} Parameter] | Specifies the minimum document frequency (the number of documents matching a term) for which the {{filterCache}} should be used when determining the constraint count for that term. |
| [facet.threads|#The {{facet.threads}} Parameter] | Controls parallel execution of field faceting |
These parameters are described in the sections below.
h3. The {{facet.field}} Parameter
The {{facet.field}} parameter identifies a field that should be treated as a facet. It iterates over each Term in the field and generate a facet count using that Term as the constraint. This parameter can be specified multiple times in a query to select multiple facet fields.
{note}
If you do not set this parameter to at least one field in the schema, none of the other parameters described in this section will have any effect.
{note}
h3. The {{facet.prefix}} Parameter
The {{facet.prefix}} parameter limits the terms on which to facet to those starting with the given string prefix. This does not limit the query in any way, only the facets that would be returned in response to the query.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.prefix}}.
h3. The {{facet.sort}} Parameter
This parameter determines the ordering of the facet field constraints.
{note}
The true/false values for this parameter were deprecated in Solr 1.4.
{note}
|| {{facet.sort}} Setting || Results ||
| count | Sort the constraints by count (highest count first). |
| index | Return the constraints sorted in their index order (lexicographic 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, otherwise, the default is {{index}}.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.sort}}.
h3. The {{facet.limit}} Parameter
This parameter specifies the maximum number of constraint counts (essentially, the number of facets for a field that are returned) that should be returned for the facet fields. A negative value means that Solr will return unlimited number of constraint counts.
The default value is 100.
This parameter can be specified on a per-field basis to apply a distinct limit to each field with the syntax of {{f.<fieldname>.facet.limit}}.
h3. The {{facet.offset}} Parameter
The {{facet.offset}} parameter indicates an offset into the list of constraints to allow paging.
The default value is 0.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.offset}}.
h3. The {{facet.mincount}} Parameter
The {{facet.mincount}} parameter specifies the minimum counts required for a facet field to be included in the response. If a field's counts are below the minimum, the field's facet is not returned.
The default value is 0.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.mincount}}.
h3. The {{facet.missing}} Parameter
If set to true, this parameter indicates that, in addition to the Term-based constraints of a facet field, a count of all results that match the query but which have no facet value for the field should be computed and returned in the response.
The default value is false.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.missing}}.
h3. The {{facet.method}} Parameter
The facet.method parameter selects the type of algorithm or method Solr should use when faceting a field.
|| Setting || Results ||
| enum | Enumerates all terms in a field, calculating the set intersection of documents that match the term with documents that match the query. This method is recommended for faceting multi-valued fields that have only a few distinct values. The average number of values per document does not matter. For example, faceting on a field with U.S. States such as {{Alabama, Alaska, ... Wyoming}} would lead to fifty cached filters which would be used over and over again. The {{filterCache}} should be large enough to hold all the cached filters. |
| fc | Calculates facet counts by iterating over documents that match the query and summing the terms that appear in each document. This is currently implemented using an {{UnInvertedField}} cache if the field either is multi-valued or is tokenized (according to {{FieldType.isTokened()}}). Each document is looked up in the cache to see what terms/values it contains, and a tally is incremented for each value. This method is excellent for situations where the number of indexed values for the field is high, but the number of values per document is low. For multi-valued fields, a hybrid approach is used that uses term filters from the {{filterCache}} for terms that match many documents. The letters {{fc}} stand for field cache. |
| fcs | Per-segment field faceting for single-valued string fields. Enable with {{facet.method=fcs}} and control the number of threads used with the {{threads}} local parameter. This parameter allows faceting to be faster in the presence of rapid index changes. |
The default value is {{fc}} (except for fields using the {{BoolField}} field type) since it tends to use less memory and is faster when a field has many unique terms in the index.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.method}}.
h3. The {{facet.enum.cache.minDf}} Parameter
This parameter indicates the minimum document frequency (the 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 with the {{facet.method=enum}} method of faceting.
A value greater than zero decreases the filterCache's memory usage, but increases the time required for the query to be processed. If you are faceting on a field with a very large number of terms, and you wish to decrease memory usage, try setting this parameter to a value between 25 and 50, and run a few tests. Then, optimize the parameter setting as necessary.
The default value is 0, causing the filterCache to be used for all terms in the field.
This parameter can be specified on a per-field basis with the syntax of {{f.<fieldname>.facet.enum.cache.minDF}}.
h3. The {{facet.threads}} Parameter
This param will cause loading the underlying fields used in faceting to be executed in parallel with the number of threads specified. Specify as {{facet.threads=N}} where {{N}} is the maximum number of threads used. Omitting this parameter or specifying the thread count as 0 will not spawn any threads, and only the main request thread will be used. Specifying a negative number of threads will create up to Integer.MAX_VALUE threads.
h2. Range Faceting
You can use Range Faceting on any date field or any numeric field that supports range queries. This is particularly useful for stitching together a series of range queries (as facet by query) for things like prices. As of Solr 3.1, Range Faceting is preferred over [Date Faceting|#Date Faceting Parameters] (described below).
|| Parameter || Description ||
| [facet.range|#The {{facet.range}} Parameter] | Specifies the field to facet by range. |
| [facet.range.start|#The {{facet.range.start}} Parameter] | Specifies the start of the facet range. |
| [facet.range.end|#The {{facet.range.end}} Parameter] | Specifies the end of the facet range. |
| [facet.range.gap|#The {{facet.range.gap}} Parameter] | Specifies the span of the range as a value to be added to the lower bound. |
| [facet.range.hardend|#The {{facet.range.hardend}} Parameter] | A boolean parameter that specifies how Solr handles a range gap that cannot be evenly divided between the range start and end values. If true, the last range constraint will have the {{facet.range.end}} value an upper bound. If false, the last range will have the smallest possible upper bound greater then {{facet.range.end}} such that the range is the exact width of the specified range gap. The default value for this parameter is false. |
| [facet.range.include|#The {{facet.range.include}} Parameter] | Specifies inclusion and exclusion preferences for the upper and lower bounds of the range. See the {{facet.range.include}} topic for more detailed information. |
| [facet.range.other|#The {{facet.range.other}} Parameter] | Specifies counts for Solr to compute in addition to the counts for each facet range constraint. |
h3. The {{facet.range}} Parameter
The {{facet.range}} parameter defines the field for which Solr should create range facets. For example:
{{facet.range=price&facet.range=age}}
h3. The {{facet.range.start}} Parameter
The {{facet.range.start}} parameter specifies the lower bound of the ranges. You can specify this parameter on a per field basis with the syntax of {{f.<fieldname>.facet.range.start}}. For example:
{{f.price.facet.range.start=0.0&f.age.facet.range.start=10}}
h3. The facet.range.end Parameter
The facet.range.end specifies the upper bound of the ranges. You can specify this parameter on a per field basis with the syntax of {{f.<fieldname>.facet.range.end}}. For example:
{{f.price.facet.range.end=1000.0&f.age.facet.range.start=99}}
h3. The {{facet.range.gap}} Parameter
The span of each range expressed as a value to be added to the lower bound. For date fields, this should be expressed using the [{{DateMathParser}} syntax|http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/util/DateMathParser.html] (such as, {{facet.range.gap=%2B1DAY ... '+1DAY'}}). You can specify this parameter on a per-field basis with the syntax of {{f.<fieldname>.facet.range.gap}}. For example:
{{f.price.facet.range.gap=100&f.age.facet.range.gap=10}}
Gaps can also be variable width by passing in a comma separated list 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 applications where one might want to facet by distance into three buckets: walking (0-5KM), driving (5-100KM), or other (100KM+). For example:
{{facet.date.gap=1,2,3,10}}
This creates 4\+ buckets of size, 1, 2, 3 and then 0 or more buckets of 10 days each, depending on the start and end values.
h3. The {{facet.range.hardend}} Parameter
The {{facet.range.hardend}} parameter is a Boolean parameter that specifies how Solr should handle cases where the {{facet.range.gap}} does not divide evenly between {{facet.range.start}} and {{facet.range.end}}. If *true*, the last range constraint will have the {{facet.range.end}} value as an upper bound. If *false*, the last range will have the smallest possible upper bound greater then {{facet.range.end}} such that the range is the exact width of the specified range gap. The default value for this parameter is false. This parameter can be specified on a per field basis with the syntax {{f.<fieldname>.facet.range.hardend}}.
h3. The {{facet.range.include}} Parameter
By default, the ranges used to compute range faceting between {{facet.range.start}} and {{facet.range.end}} are inclusive of their lower bounds and exclusive of the upper bounds. The "before" range defined with the {{facet.range.other}} parameter is exclusive and the "after" range is inclusive. This default, equivalent to "lower" below, will not result in double counting at the boundaries. You can use the {{facet.range.include}} parameter to modify this behavior using the following options:
|| Option || Description ||
| lower | All gap-based ranges include their lower bound. |
| upper | All gap-based ranges include their upper bound. |
| edge | The first and last gap ranges include their edge bounds (lower for the first one, upper for the last one) even if the corresponding upper/lower option is not specified. |
| outer | The "before" and "after" ranges will be inclusive of their bounds, even if the first or last ranges already include those boundaries. |
| all | Includes all options: lower, upper, edge, outer. |
You can specify this parameter on a per field basis with the syntax of {{f.<fieldname>.facet.range.include}}, and you can specify it multiple times to indicate multiple choices.
{info}
To ensure you avoid double-counting, do not choose both {{lower}} and {{upper}}, do not choose {{outer}}, and do not choose {{all}}.
{info}
h3. The {{facet.range.other}} Parameter
The {{facet.range.other}} parameter specifies that in addition to the counts for each range constraint between {{facet.range.start}} and {{facet.range.end}}, counts should also be computed for these options:
|| Option || Description ||
| before | All records with field values lower then lower bound of the first 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 end bounds of all ranges. |
| none | Do not compute any counts. |
| all | Compute counts for before, between, and after. |
This parameter can be specified on a per field basis with the syntax of {{f.<fieldname>.facet.range.other}}. In addition to the {{all}} option, this parameter can be specified multiple times to indicate multiple choices, but {{none}} will override all other options.
h3. facet.range.hardend
A Boolean parameter instructing Solr what to do in the event that {{facet.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 have the smallest possible upper bound greater then {{facet.range.end}} such that the range is exactly {{facet.range.gap}} wide.
The default is false.
This parameter can be specified on a per field basis.
h3. facet.range.other
This param indicates that in addition to the counts for each range constraint between {{facet.range.start}} and {{facet.range.end}}, counts should also be computed for...
* {{before}} all records with field values lower then lower bound of the first 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 end bounds of all ranges
* {{none}} compute none of this information
* {{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 multiple times to indicate multiple choices \-\- but {{none}} will override all other options.
h3. facet.range.include
By default, the ranges used to compute range faceting between facet.range.start and facet.range.end are inclusive of their lower bounds and exclusive of the upper bounds. The "before" range is exclusive and the "after" range 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 the following options...
* {{lower}} = all gap based ranges include their lower bound
* {{upper}} = all gap based ranges include their upper bound
* {{edge}} = the first and last gap ranges include their edge bounds (i.e., lower for the first one, upper for the last one) even if the corresponding upper/lower option is not specified
* {{outer}} = the "before" and "after" ranges will be inclusive of their bounds, even if the first or last ranges already include those boundaries.
* {{all}} = 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 choices.
If you want to ensure you don't double-count, don't choose both lower & upper, don't choose outer, and don't choose all.
h2. Date Faceting Parameters
As of Solr 3.1, date faceting has been deprecated in favor of [Range Faceting|#Range Faceting Parameters], which provides more flexibility with dates and numeric fields. Date Faceting can be used, however. The response structure is slightly different, but the functionality is equivalent (except that it supports numeric fields as well as dates).
Several parameters can be used to trigger faceting based on Date ranges computed using simple [DateMathParser|http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/util/DateMathParser.html] expressions.
When using Date Faceting, the {{facet.date}}, {{facet.date.start}}, {{facet.date.end}}, and {{facet.date.gap}} parameters are all mandatory.
| *Name* | *What it does* |
| facet.date | Allows you to specify names of fields (of type {{DateField}}, described in the section, [Field Types Included with Solr]) which should be treated as date facets. Can be specified multiple times to indicate multiple date facet fields. |
| facet.date.start | The lower boundary for the first date range for all Date Faceting on this field. This should be a single date expression which may use the [DateMathParser|http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/util/DateMathParser.html] syntax. Can be specified on a per field basis. |
| facet.date.end | The minimum upper boundary for the last date range for all Date Faceting on this field. This should be a single date expression which may use the [DateMathParser|http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/util/DateMathParser.html] syntax. Can be specified on a per field basis. |
| facet.date.gap | The size of each date range expressed as an interval to be added to the lower bound using the [DateMathParser|http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/util/DateMathParser.html] syntax. Can be specified on a per field basis. Example: {{facet.date.gap=%2B1DAY}} (+1DAY) |
| facet.date.other | Indicates that in addition to the counts for each date range constraint between {{facet.date.start}} and {{facet.date.end}}, counts should also be computed for:
* {{before:}} all records with field values lower then lower bound of the first 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 end bounds of all ranges
* {{none}}: compute none of this information
* {{all}}: shortcut for {{before}}, {{between}}, and {{after}}. \\
\\
Can be specified on a per field basis. In addition to the {{all}} option, this parameter can be specified multiple times to indicate multiple choices, but {{none}} will override all other options. |
| facet.date.include | By default, the ranges used to compute date faceting between {{facet.date.start}} and {{facet.date.end}} are all inclusive of both endpoints, while the "before" and "after" ranges are not inclusive. This behavior can be modified by the {{facet.date.include}} parameter, which can be any combination of the following options:
* {{lower}} = all gap based ranges include their lower bound
* {{upper}} = all gap based ranges include their upper bound
* {{edge}} = the first and last gap ranges include their edge bounds (ie: lower for the first one, upper for the last one) even if the corresponding upper/lower option is not specified
* {{outer}} = the "before" and "after" ranges will be inclusive of their bounds, even if the first or last ranges already include those boundaries.
* {{all}} = shorthand for lower, upper, edge, outer \\
\\
This parameter can be specified on a per field basis, and can be specified multiple times to indicate multiple choices. |
h2. Local Parameters for Faceting
The [LocalParams syntax|solr:Local Parameters in Queries] allows overriding global settings. It can also provide a method of adding metadata to other parameter values, much like XML attributes.
h3. Tagging and Excluding Filters
You can tag specific filters and exclude those filters when faceting. This is useful when doing multi-select faceting.
Consider the following example query with faceting:
{{q=mainquery&fq=status:public&fq=doctype:pdf&facet=on&facet.field=doctype}}
Because everything is already constrained by the filter {{doctype:pdf}}, the {{facet.field=doctype}} 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 display the other doctype values and their associated counts, as if the {{doctype:pdf}} constraint had not yet been applied. For example:
{code:borderStyle=solid|borderColor=#666666}
=== Document Type ===
[ ] Word (42)
[x] PDF (96)
[ ] Excel(11)
[ ] HTML (63)
{code}
To return counts for doctype values that are currently not selected, tag filters that directly constrain doctype, and exclude those filters when faceting on doctype.
{{q=mainquery&fq=status:public&fq=\{\!tag=dt\}doctype:pdf&facet=on&facet.field=\{\!ex=dt\}doctype}}
Filter exclusion is supported for all types of facets. Both the {{tag}} and {{ex}} local parameters may specify multiple values by separating them with commas.
h3. Changing the Output Key
To change the output key for a faceting command, specify a new name with the {{key}} local parameter. For example:
{{facet.field=\{\!ex=dt key=mylabel\}doctype}}
The parameter setting above causes the results to be returned under the key "mylabel" rather than "doctype" in the response. This can be helpful when faceting on the same field multiple times with different exclusions.
h2. Pivot (Decision Tree) Faceting
Pivoting is a summarization tool that lets you automatically sort, count, total or average data stored in a table. It displays the results in a second table showing the summarized data. Pivot faceting lets you create a summary table of the results from a query across numerous documents. With Solr 4, pivot faceting supports nested facet queries, not just facet fields.
Another way to look at it is that the query produces a Decision Tree, in that Solr tells you "for facet A, the constraints/counts are X/N, Y/M, etc. If you were to constrain A by X, then the constraint counts for B would be S/P, T/Q, etc.". In other words, it tells you in advance what the "next" set of facet results would be for a field if you apply a constraint from the current facet results.
h3. facet.pivot
The {{facet.pivot}} parameter defines the fields to use for the pivot. Multiple {{facet.pivot}} values will create multiple "facet_pivot" sections in the response. Separate each list of fields with a comma.
As of Solr 4.1, local parameters can be used in pivot facet queries.
h3. facet.pivot.mincount
The {{facet.pivot.mincount}} parameter defines the minimum number of documents that need to match in order for the facet to be included in results. The default is 1.
For example, we can use Solr's example data set to make a query like this:
{code:lang=html|borderStyle=solid|borderColor=#666666}
http://localhost:8983/solr/select?q=*:*&facet.pivot=cat,popularity,inStock&facet.pivot=popularity,cat
&facet=true&facet.field=cat&facet.limit=5&rows=0&wt=json&indent=true&facet.pivot.mincount=2
{code}
This query will returns the data below, with the pivot faceting results found in the section "facet_pivot":
{code:borderStyle=solid|borderColor=#666666}
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"cat":[
"electronics",14,
"currency",4,
"memory",3,
"connector",2,
"graphics card",2]},
"facet_dates":{},
"facet_ranges":{},
"facet_pivot":{
"cat,popularity,inStock":[{
"field":"cat",
"value":"electronics",
"count":14,
"pivot":[{
"field":"popularity",
"value":6,
"count":5,
"pivot":[{
"field":"inStock",
"value":true,
"count":5}]},
...
{code}
Pivot faceting supports distributed searching.
h2. Facets and Time Zone
You can construct your query to use the {{tz}} parameter, which overrides the time zone used when rounding dates in {{DateMath}} expressions for the entire request. This applies to all date range queries and date faceting.
For instance, a request that does not include date parameters, like this:
{code:borderStyle=solid|borderColor=#666666}
http://localhost:8983/solr/select?indent=on&version=2.2&q=*%3A*&fq=&start=0&rows=10&fl=*%2Cscore
&qt=&wt=&explainOther=&hl.fl=&
{code}
can be modified by adding facet parameters for dates:
{code:borderStyle=solid|borderColor=#666666}
&facet=true&facet.date=manufacturedate_dt&facet.date.start=2005-01-31T15:00:00Z
&facet.date.end=2006-05-31T15:00:00Z&facet.date.gap=%2B1MONTH/DAY&facet.date.tz=Asia/Tokyo
{code}
The result would be a date facet request with monthly gap in Tokyo time (GMT+9:00).
One problem may be that some time zones observe Daylight Savings Time, and some don't. For instance, consider this query:
{code:borderStyle=solid|borderColor=#666666}
http://localhost:8983/solr/select?indent=on&version=2.2&q=*%3A*&fq=&start=0&rows=10&fl=*%2Cscore&qt=&wt=
&explainOther=&hl.fl=&start = 2007-07-30T00:00:00.000Z/DAY&end = 2007-07-31T00:00:00.000Z/DAY
&gap = \+1DAY&tz=Asia/Singapore
{code}
The way to make sure that your return reflects Daylight Savings Time is to simply add '/DAY' to the end of each parameter, which will round the times to the beginning of the day. Since the rounding takes {{tz}} into account, this query will come out to 8:00 (the difference between GMT and Singapore time).
{code:borderStyle=solid|borderColor=#666666}
&start=2007-07-30T00:00:00.000Z/DAY&end=2007-07-31T00:00:00.000Z/DAY
&gap=+1DAY&tz=Asia/Singapore
{code}
h2. Related Topics
* [SimpleFacetParameters|http://wiki.apache.org/solr/SimpleFacetParameters] from the Solr Wiki.
{scrollbar}
Stop watching space: https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=solr
Change email notification preferences: https://cwiki.apache.org/confluence/users/editmyemailsettings.action