lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eduard Zlotnik (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SOLR-9904) JSON API facet incorrect counts for specific values when exclusion applied
Date Thu, 29 Dec 2016 08:15:58 GMT

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

Eduard Zlotnik edited comment on SOLR-9904 at 12/29/16 8:15 AM:
----------------------------------------------------------------

Hello.

We have an indexed filed which defined in schema as following :
{code:title=schema definition|theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}
<field name="interaction_sentiment" type="int" indexed="true" stored="true" required="false"
multiValued="false" /> 
{code}

The Solr setup is cloud  4 shards collection.
The indexed field  can store one of  5 int values : -2,-1,0,1,2

When the excluded fq has value of 2 or -2, the counts are incorrect.
For -1,0,1 values in excluded fq, the facet counts are fine.


Query the produces incorrect results.
{code:title=query|theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}
q=*:*&fq=content_type:PARENT&rows=0&wt=json&indent=true&fq={!tag=tagForSentiment}interaction_sentiment:2
&json.facet={
	facetForinteraction_sentiment: 
      {
       type : terms, 
       method : dv, 
       field : interaction_sentiment,	   
       excludeTags: tagForSentiment       
  }
}
{code}


Correct counts:
{code:title=correct counts |theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}

"facets":{
    "count":143,
    "facetForinteraction_sentiment":{
      "buckets":[{
          "val":0,
          "count":356},
        {
          "val":-1,
          "count":152},
        {
          "val":1,
          "count":143},
        {
          "val":-2,
          "count":5},
        {
          "val":2,
          "count":1}]}}}
{code}

Incorrect counts :
{code:title=incorrect counts |theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}

"facets":{
    "count":1,
    "facetForinteraction_sentiment":{
      "buckets":[{
          "val":0,
          "count":86},
        {
          "val":1,
          "count":37},
        {
          "val":-1,
          "count":33},
        {
          "val":-2,
          "count":3},
        {
          "val":2,
          "count":1}]}}}
{code}

The simple facet query produces correct counts consistently:

{code:title=simple facet and json facet |theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}

q=*:*&fq=content_type:PARENT&rows=0&wt=json&indent=true&fq={!tag=tagForSentiment}interaction_sentiment:2
&json.facet={
	facetForinteraction_sentiment: 
      {
       type : terms, 
       method : dv, 
       field : interaction_sentiment,	   
       excludeTags: tagForSentiment             
  }
}&facet=on&facet.field={!ex=tagForSentiment}interaction_sentiment&facet.threads=8

{code}

{code:title=result|theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}

"facet_counts":{
    "facet_queries":{},
    "facet_fields":{
      "interaction_sentiment":[
        "0",356,
        "-1",152,
        "1",143,
        "-2",5,
        "2",1]},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_heatmaps":{}},
  "facets":{
    "count":1,
    "facetForinteraction_sentiment":{
      "buckets":[{
          "val":0,
          "count":86},
        {
          "val":1,
          "count":37},
        {
          "val":-1,
          "count":33},
        {
          "val":-2,
          "count":3},
        {
          "val":2,
          "count":1}]}}}

{code}

It seems that for -2 and 2 values, the JSON Facet counts are calculated only on one of 4 shards.


was (Author: eduardzl):
Hello.

We have an indexed filed which defined in schema as following :
{code:title=schema definition|theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}
<field name="interaction_sentiment" type="int" indexed="true" stored="true" required="false"
multiValued="false" /> 
{code}

The Solr setup is cloud  4 shards collection.
The indexed field  can store one of  of 5 int values : -2,-1,0,1,2
When using the following queries the JSON facet counts are incorrect.

{code:title=query|theme=FadeToGrey|linenumbers=true|language=html/xml|firstline=0001|collapse=true}
q=*:*&fq=content_type:PARENT&rows=0&wt=json&indent=true&fq={!tag=tagForSentiment}interaction_sentiment:2
&json.facet={
	facetForinteraction_sentiment: 
      {
       type : terms, 
       method : dv, 
       field : interaction_sentiment,	   
       excludeTags: tagForSentiment       
  }
}
{code}




> JSON API facet incorrect counts for specific values when exclusion applied
> --------------------------------------------------------------------------
>
>                 Key: SOLR-9904
>                 URL: https://issues.apache.org/jira/browse/SOLR-9904
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Facet Module
>    Affects Versions: 6.2.1, 6.3
>            Reporter: Eduard Zlotnik
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message