You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Andrew Nagy (JIRA)" <ji...@apache.org> on 2008/12/23 07:33:44 UTC

[jira] Created: (SOLR-936) Facet Results - REST vs SolrJ

Facet Results - REST vs SolrJ
-----------------------------

                 Key: SOLR-936
                 URL: https://issues.apache.org/jira/browse/SOLR-936
             Project: Solr
          Issue Type: Bug
          Components: clients - java, search
    Affects Versions: 1.4
            Reporter: Andrew Nagy
            Priority: Minor
             Fix For: 1.4


There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  

The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.

Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Andrew Nagy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658871#action_12658871 ] 

Andrew Nagy commented on SOLR-936:
----------------------------------

It might also be beneficial to have a list of "Applied Facets" so we can differentiate whether a facet has been applied and what the count is for that facet.

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658884#action_12658884 ] 

Ryan McKinley commented on SOLR-936:
------------------------------------

actually, perhaps you are using:

QueryResponse#getFacetFields()
   vs
QueryResponse#getLimitingFacets();

The first returns all results directly from solr, the second returns facets that will reduce the number of documents returned.

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Andrew Nagy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Nagy resolved SOLR-936.
------------------------------

    Resolution: Invalid

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658875#action_12658875 ] 

Ryan McKinley commented on SOLR-936:
------------------------------------

Are you talking about:
{code:java}
   public FacetField getLimitingFields(long max) 
{code}

If so, that is just a utility function that lets you filter out facets that have fewer options that some number (typically getNumFound)

If you don't want filtered results, just that FacetField directly and call:
{code:java}
   public List<Count> getValues();
{code}

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Jayson Minard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658874#action_12658874 ] 

Jayson Minard commented on SOLR-936:
------------------------------------

I see what Andrew is talking about.

The difference is this:

Solrj returns a list of further refinements, so it strips out anything that would not further reduce the set.  It says, if the facet count == the total document count, don't return it in the list of further refinements.

Whereas the raw response obviously has not yet stripped it.

So Solrj could probably use a list of facets that are not further refinements if it is interesting for users of the API to have those.  They don't make sense as possible new refinements but they do make sense in that they exist and some people care that they exist in the resulting data.

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659001#action_12659001 ] 

Ryan McKinley commented on SOLR-936:
------------------------------------

You may also want to check out SOLR-911 or SOLR-792 -- solrj does not deal with this functionality yet.  Contributions are welcome!

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Andrew Nagy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Nagy reopened SOLR-936:
------------------------------


I am referring to the code in SolrJ that filters out any facets with the same count as the total number of search results.  This is different from the REST interface.

See the bottom of:
http://svn.apache.org/viewvc/lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/response/FacetField.java?revision=724175&view=markup

Solrj filters out facet values where as the raw output from the REST interface does not.

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Jayson Minard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658904#action_12658904 ] 

Jayson Minard commented on SOLR-936:
------------------------------------

erk.  Guess I got caught up in the fun and games...  I always thing of getFacetFields() as the list of facet fields passed in as the requested set of facets, not the response.  Don't know where my brain was at.

Guessing that solves Andrew's problem and this should be closed.

Andrew?

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley resolved SOLR-936.
--------------------------------

    Resolution: Invalid

There is no difference between the results in solrj and directly querying solr (solrj makes the same calls to solr)

Your issues is probably related to facet.mincount=0 vs facet.mincount=1.
check:
http://wiki.apache.org/solr/SimpleFacetParameters

it that does not fix things, ask on solr-user@lucene...

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Andrew Nagy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658934#action_12658934 ] 

Andrew Nagy commented on SOLR-936:
----------------------------------

Yes - thanks - this does solve my problem.

In regards to the "Applied Facets" it might be nice to separate the list of returned facets to a list of available facets and a list of "applied" facets.

What is driving this idea is my curiosity on how to build a list of facets that uses checkboxes instead of links.  How do I know if the checkboxes should be checked or not with out saving some state information about what the user clicked on.  It would be nice if solr could do this for me by either flagging the facets that are in my fq or by keeping them in a different list.

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-936) Facet Results - REST vs SolrJ

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658880#action_12658880 ] 

Ryan McKinley commented on SOLR-936:
------------------------------------

| It might also be beneficial to have a list of "Applied Facets" 

I don't follow -- as is, every facet that is applied creates a section in the response (not to mention that you put it in the request).  What am i missing?

Are you talking about fq=?

> Facet Results - REST vs SolrJ
> -----------------------------
>
>                 Key: SOLR-936
>                 URL: https://issues.apache.org/jira/browse/SOLR-936
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.4
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> There is a difference in the way Facet results are reported in SolrJ from the REST interface.  In REST, if you apply a facet via the fq param, no matter what the count it is always reported back in the list of facets in the responses.  However, with SolrJ - it only reports back facets that don't match the total number of documents.  This is quite frustrating to deal with.  
> The difference can be seen when ORing or ANDing in the fq param.  When I or to facet values together, they come back in SolrJ since their counts don't match the total docs.  But if I AND them together, they don't appear in the list.  So then I need to munge in the applied fq values.
> Why the difference in behavior between REST and SolrJ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.