[
https://issues.apache.org/jira/browse/SOLR-2242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173479#comment-13173479
]
Cody Young commented on SOLR-2242:
----------------------------------
Simon, any plans for this patch?
The general consensus seems to be that this is a good patch and desired
functionality. The biggest issues seem to be the magic name and distributed
support. I see a proposed solution by Yonik of changing the output format but
that breaks distributed search. In addition, there is a worry about backwards
compatibility and possibly supporting that through a parameter.
What if we choose a format that doesn't break backwards compatibility and
possibly commit without supporting distributed for the first pass (or
supporting the simple case of just adding it all together). This would let us
get some progress on this issue without having a magic name in the facet list.
If we went with a format like below then it wouldn't break backwards
compatibility and it shouldn't affect anyone unless they choose to use the
feature. This is also consistent with the way numFound works for the main
search results. (Admittedly, it's different than ngroups, although we still see
numFound used to represent the number of documents in a group.)
{code:xml}
<lst name="facet_fields">
<lst name="text" numFacetTerms="385">
<int name="electronics">14</int>
<int name="inc">8</int>
<int name="2.0">5</int>
<int name="lcd">5</int>
<int name="memory">5</int>
</lst>
</lst>
{code}
Other smaller issues that appear to be outstanding:
Change code to cache the numFacetTerms/numTerms and remove the code that caches
the huge term list.
Determine the parameter name: facet.nconstraints=true|false was proposed,
allowing facet.count to control the rest of the behavior.
> Get distinct count of names for a facet field
> ---------------------------------------------
>
> Key: SOLR-2242
> URL: https://issues.apache.org/jira/browse/SOLR-2242
> Project: Solr
> Issue Type: New Feature
> Components: Response Writers
> Affects Versions: 4.0
> Reporter: Bill Bell
> Assignee: Simon Willnauer
> Priority: Minor
> Fix For: 4.0
>
> Attachments: NumFacetTermsFacetsTest.java,
> SOLR-2242-notworkingtest.patch, SOLR-2242.patch, SOLR-2242.patch,
> SOLR-2242.shard.patch, SOLR-2242.shard.patch,
> SOLR-2242.shard.withtests.patch, SOLR-2242.solr3.1-fix.patch,
> SOLR-2242.solr3.1.patch, SOLR.2242.solr3.1.patch, SOLR.2242.v2.patch
>
>
> When returning facet.field=<name of field> you will get a list of matches for
> distinct values. This is normal behavior. This patch tells you how many
> distinct values you have (# of rows). Use with limit=-1 and mincount=1.
> The feature is called "namedistinct". Here is an example:
> http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:7574/solr&indent=true&q=*:*&facet=true&facet.mincount=1&facet.numFacetTerms=2&facet.limit=-1&facet.field=price
> http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:7574/solr&indent=true&q=*:*&facet=true&facet.mincount=1&facet.numFacetTerms=0&facet.limit=-1&facet.field=price
> http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:7574/solr&indent=true&q=*:*&facet=true&facet.mincount=1&facet.numFacetTerms=1&facet.limit=-1&facet.field=price
> This currently only works on facet.field.
> {code}
> <lst name="facet_fields">
> <lst name="price">
> <int name="numFacetTerms">14</int>
> <int name="0.0">3</int><int name="11.5">1</int><int
> name="19.95">1</int><int name="74.99">1</int><int name="92.0">1</int><int
> name="179.99">1</int><int name="185.0">1</int><int name="279.95">1</int><int
> name="329.95">1</int><int name="350.0">1</int><int name="399.0">1</int><int
> name="479.95">1</int><int name="649.99">1</int><int name="2199.0">1</int>
> </lst>
> </lst>
> {code}
> Several people use this to get the group.field count (the # of groups).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]