lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Cariens <richcari...@gmail.com>
Subject Re: an OR filter query
Date Sun, 04 Apr 2010 19:41:55 GMT
Why not just make the your "mature:false" filter query a default value
instead of always appended?  I.e.:

-snip-
<lst name="defaults">
    <str name="fq">mature:false</str>
</lst>
-snip-

That way if someone wants mature items in their results the search client
explicitly sets "fq=mature:*" or whatever.

Would that work?

On Sun, Apr 4, 2010 at 3:27 PM, Blargy <zmanods@hotmail.com> wrote:

>
> Is there anyway to use a filter query as an OR clause?
>
> For example I have product listings and I want to be able to filter out
> mature items by default. To do this I added:
>
> <lst name="appends">
>  <str name="fq">mature:false</str>
> </lst>
>
> But then I can never return any mature items because appending
> fq=mature:true will obviously return 0 results because no item can both be
> mature and non-mature.
>
> I can get around this using defaults:
>
> <lst name="default">
>  <str name="fq">mature:false</str>
> </lst>
>
> But this is a little hacky because anytime I want to include mature items
> with non-mature items I need to explicitly set fq as a blank string.
>
> So is there any better way to do this? Thanks
> --
> View this message in context:
> http://n3.nabble.com/an-OR-filter-query-tp696579p696579.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message