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 Lee Smith <le...@weblee.co.uk> on 2010/01/26 19:52:28 UTC

Query 2 Cats

Sorry of this is a poor Q but cant seem to get it to work.

I have a field called cat setup so I can query against specific categories.

It ok I search all or one but cant seem to make it search over multiples.

ie q=string AND cat:name1 AND cat:name2

I have tried the following variations.

cat:name1,name2
cat:name1+name2

I have also tried using & instead of AND with still same results.

Hope you can help !!

Thank you in advance


Re: Query 2 Cats

Posted by Lee Smith <le...@weblee.co.uk>.
Thank you Dave, Eric

Worked a charm


On 26 Jan 2010, at 18:58, Dave Searle wrote:

> Try
> 
>> q=string AND (cat:name1 OR cat:name2)
> 
> 
> On 26 Jan 2010, at 18:53, "Lee Smith" <le...@weblee.co.uk> wrote:
> 
>> Sorry of this is a poor Q but cant seem to get it to work.
>> 
>> I have a field called cat setup so I can query against specific  
>> categories.
>> 
>> It ok I search all or one but cant seem to make it search over  
>> multiples.
>> 
>> ie q=string AND cat:name1 AND cat:name2
>> 
>> I have tried the following variations.
>> 
>> cat:name1,name2
>> cat:name1+name2
>> 
>> I have also tried using & instead of AND with still same results.
>> 
>> Hope you can help !!
>> 
>> Thank you in advance
>> 


Re: Query 2 Cats

Posted by Dave Searle <da...@magicalia.com>.
Try

> q=string AND (cat:name1 OR cat:name2)


On 26 Jan 2010, at 18:53, "Lee Smith" <le...@weblee.co.uk> wrote:

> Sorry of this is a poor Q but cant seem to get it to work.
>
> I have a field called cat setup so I can query against specific  
> categories.
>
> It ok I search all or one but cant seem to make it search over  
> multiples.
>
> ie q=string AND cat:name1 AND cat:name2
>
> I have tried the following variations.
>
> cat:name1,name2
> cat:name1+name2
>
> I have also tried using & instead of AND with still same results.
>
> Hope you can help !!
>
> Thank you in advance
>

Re: Query 2 Cats

Posted by Erick Erickson <er...@gmail.com>.
Tell us more about the cat field. Is there one (and only one)
value per document? Or are there multiple values per
document? Because if there's only one cat value/doc,
you want something like q=string AND (cat:name1 OR cat:name2)

Erick

On Tue, Jan 26, 2010 at 1:52 PM, Lee Smith <le...@weblee.co.uk> wrote:

> Sorry of this is a poor Q but cant seem to get it to work.
>
> I have a field called cat setup so I can query against specific categories.
>
> It ok I search all or one but cant seem to make it search over multiples.
>
> ie q=string AND cat:name1 AND cat:name2
>
> I have tried the following variations.
>
> cat:name1,name2
> cat:name1+name2
>
> I have also tried using & instead of AND with still same results.
>
> Hope you can help !!
>
> Thank you in advance
>
>