You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by nbosecker <nb...@gmail.com> on 2014/11/21 02:08:31 UTC

Multiple facet.query ignored

Hi,

I'm having problems with queries that have multiple facet.query fields.

Per the docs:
[http://wiki.apache.org/solr/SimpleFacetParameters#Facet_Fields_and_Facet_Queries]

http://localhost:8983/solr/select?q=video&rows=0&facet=true&facet.field=inStock&facet.query=price:[*+TO+500]&facet.query=price:[500+TO+*]

<response>
<responseHeader><status>0</status><QTime>11</QTime></responseHeader>
<result numFound="3" start="0"/>
<lst name="facet_counts">
 <lst name="facet_queries">
  <int name="price:[* TO 500]">2</int>
  <int name="price:[500 TO *]">1</int>
 </lst>
 <lst name="facet_fields">
  <lst name="inStock">
        <int name="false">2</int>
        <int name="true">1</int>
  </lst>
 </lst>
</lst>
</response>

----
When I try this locally, the query:
select?q=*:*&rows=1&facet=true&facet.field=domain&facet.query=lastsaveddate:[NOW-7DAY
TO NOW]&facet.query=lastsaveddate:[NOW-1MONTH TO NOW]

The response is this - note that the first facet.query is lost:
<response>
    <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">60</int>
        <lst name="params">
            <str name="facet">true</str>
            <str name="facet.query">lastsaveddate:[NOW-1MONTH TO NOW]</str>
            <str name="q">*:*</str>
            <str name="facet.field">domain</str>
            <str name="rows">1</str>
        </lst>
    </lst>
...
    <lst name="facet_counts">
        <lst name="facet_queries">
            <int name="lastsaveddate:[NOW-1MONTH TO NOW]">16</int>
        </lst>
        <lst name="facet_fields">
            <lst name="domain">
                <int name="text">9</int>
            </lst>
        </lst>
        <lst name="facet_dates"/>
        <lst name="facet_ranges"/>
        <lst name="facet_intervals"/></lst>
</response>

Am I doing something incorrectly? 




--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-facet-query-ignored-tp4170204.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple facet.query ignored

Posted by Erick Erickson <er...@gmail.com>.
Whew! Thanks for closing this off.

Best,
Erick

On Fri, Nov 21, 2014 at 9:11 AM, nbosecker <nb...@gmail.com> wrote:
> Good call - we are adding some ACL to the query going in, and using a Map to
> store the original query values, if there are multiple of the same key, it's
> only storing the last value.
>
> My bad! Thanks for the hint, I wasn't even considering that issue.
>
> Best,
> Nancy
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Multiple-facet-query-ignored-tp4170204p4170282.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple facet.query ignored

Posted by nbosecker <nb...@gmail.com>.
Good call - we are adding some ACL to the query going in, and using a Map to
store the original query values, if there are multiple of the same key, it's
only storing the last value.

My bad! Thanks for the hint, I wasn't even considering that issue. 

Best,
Nancy



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-facet-query-ignored-tp4170204p4170282.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple facet.query ignored

Posted by Erick Erickson <er...@gmail.com>.
This is totally weird. What version of Solr? Because the strangest thing
is that the facet.query clause is getting lost on the way _in_. When I tried
this query (5x, I'll admit), at least the echo params at the top had both
facet queries, even when the lastsaveddate was undefined!

In fact if I put bogus junk in the params like facet.querysdf=[* TO NOW], the
facet.querysdf gets echoed back in the response params section.

This is supposed to work just like you're typing it in, is there anything else
in your system that could be stripping this out?

Best,
Erick

On Thu, Nov 20, 2014 at 5:08 PM, nbosecker <nb...@gmail.com> wrote:
> Hi,
>
> I'm having problems with queries that have multiple facet.query fields.
>
> Per the docs:
> [http://wiki.apache.org/solr/SimpleFacetParameters#Facet_Fields_and_Facet_Queries]
>
> http://localhost:8983/solr/select?q=video&rows=0&facet=true&facet.field=inStock&facet.query=price:[*+TO+500]&facet.query=price:[500+TO+*]
>
> <response>
> <responseHeader><status>0</status><QTime>11</QTime></responseHeader>
> <result numFound="3" start="0"/>
> <lst name="facet_counts">
>  <lst name="facet_queries">
>   <int name="price:[* TO 500]">2</int>
>   <int name="price:[500 TO *]">1</int>
>  </lst>
>  <lst name="facet_fields">
>   <lst name="inStock">
>         <int name="false">2</int>
>         <int name="true">1</int>
>   </lst>
>  </lst>
> </lst>
> </response>
>
> ----
> When I try this locally, the query:
> select?q=*:*&rows=1&facet=true&facet.field=domain&facet.query=lastsaveddate:[NOW-7DAY
> TO NOW]&facet.query=lastsaveddate:[NOW-1MONTH TO NOW]
>
> The response is this - note that the first facet.query is lost:
> <response>
>     <lst name="responseHeader">
>         <int name="status">0</int>
>         <int name="QTime">60</int>
>         <lst name="params">
>             <str name="facet">true</str>
>             <str name="facet.query">lastsaveddate:[NOW-1MONTH TO NOW]</str>
>             <str name="q">*:*</str>
>             <str name="facet.field">domain</str>
>             <str name="rows">1</str>
>         </lst>
>     </lst>
> ...
>     <lst name="facet_counts">
>         <lst name="facet_queries">
>             <int name="lastsaveddate:[NOW-1MONTH TO NOW]">16</int>
>         </lst>
>         <lst name="facet_fields">
>             <lst name="domain">
>                 <int name="text">9</int>
>             </lst>
>         </lst>
>         <lst name="facet_dates"/>
>         <lst name="facet_ranges"/>
>         <lst name="facet_intervals"/></lst>
> </response>
>
> Am I doing something incorrectly?
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Multiple-facet-query-ignored-tp4170204.html
> Sent from the Solr - User mailing list archive at Nabble.com.