[ 
https://issues.apache.org/jira/browse/SOLR-11695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16269574#comment-16269574
 ] 

Hoss Man commented on SOLR-11695:
---------------------------------

bq. We already use "count" for the number of documents in a bucket,...

yeah, i'm not suggesting the original names were great, just that the 
equivilent functionality seems important -- something like "numvals(..)" would 
probably be a lot better then "count"

bq.  But you're right that we should have a missing function as well (one could 
do it themselves as a query sub0facet of "-field:\[\* TO \*\]", but we should 
make it easier and more functional).

Hmmm... That specific syntax would only help in the case of simple fields -- 
not complex functions (ie: {{stats.field=\{!func 
missing=true}min(fieldA,fieldB)}}).

I suppose in general we could beef up the FuncQParser so it (had an option to) 
only matched docs where the function {{exists()}} _and_ then maybe add some 
sort of "not_exists()" wrapper function -- so you could combine them in a 
{{type : query}} facet to get the same results w/o needing any new 
functionality/syntax in JSON Faceting ... but yea, a more "native" and easier 
to use "functional" syntax for this concept in the JSON Facet syntax would 
certainly be a lot easier to explain to users (especially existing users we're 
trying to convince to migrate)

> JSON FacetModule needs equivilents for StatsComponent's "count" and "missing" 
> features
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-11695
>                 URL: https://issues.apache.org/jira/browse/SOLR-11695
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>
> StatsComponent supports stats named "count" and "missing":
> * count: for the set of documents we're computing stats over, "how many 
> _non-distinct_ values exist in those documents in the specified field?" (or 
> in the case of an arbitrary function: "in how many of these documents does 
> true==ValueSource.exist()" ?)
> ** no to be confused with the number of _unique_ values (aprox "cardinality" 
> or exact "countDistinct")
> * missing: for the set of documents we're computing stats over, "how many of 
> those documents do not have any value in the specified field?" (or in the 
> case of an arbitrary function: "in how many of thse documents does 
> false==ValueSource.exist()" ?)
> (NOTE: for a single valued field, these are essentially inveses of each 
> other, but for multivalued fields "count" actaully returns the total number 
> of "value instances" not just the number of docs that have at least one value)
> AFAICT there is no equivalent functionality supported by the JSON 
> FacetModule, which will be a blocker preventing some users from migrating 
> from using stats.field (or facet.pivot+stats.field) to json.facet.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to