vanng822 / go-solr

Solr client in Go, core admin, add docs, update, delete, search and more
MIT License
69 stars 42 forks source link

Add facet query option #46

Closed mathewvp closed 6 years ago

mathewvp commented 6 years ago

facet.query : Arbitrary Query Faceting 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 counts 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 particularly useful for numeric range based facets, or prefix based facets -- see example below (i.e. price:[ TO 500] and price:[501 TO ]).

To specify facet queries not in the Lucene default query syntax, prefix the facet query with the name of the query notation, a la LocalParams. For example, to use the hypothetical myfunc query parser, send parameter facet.query={!myfunc}name~fred

vanng822 commented 6 years ago

Looking good, thanks for contribution @mathewvp