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 xpow <sw...@gmail.com> on 2012/12/21 10:37:20 UTC

Solr 3.6.1

Hi,

I have a case where i need to find the results of a query that search for a
exact phrase + other words, for example, if i have a keyword like:

"how about" tomorrow morning

the results that should be fetched should match these criteria:
- containing exact phrase how about <= exactly how about
- containing word tomorrow
- containing word morning

Can anybody explain to me how to do this? I tried:
q=exactText:"how+about" AND content:tomorrow+morning
q=exactText:"how+about" AND _query_:"{!dismax qf=content pf=content
v=$qq}"&qq=tomorrow+morning

but the results that i got:
(1) documents always contain phrase "how about" plus tomorrow
(2) documents always contain phrase "how about" plus morning
(3) documents always contain phrase "how about" plus tomorrow and morning

the correct results should only be (3), please help, thanks ...




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-1-tp4028502.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 3.6.1

Posted by xpow <sw...@gmail.com>.
thanks for the respond, i will try it and report back ...



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-1-tp4028502p4028675.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 3.6.1

Posted by Upayavira <uv...@odoko.co.uk>.
The default operator is OR. And the default field is 'text'. So when 

So what you did this query:

 q=exactText:"how+about" AND content:tomorrow+morning

what you did was:

Find all documents that:
  have the terms 'how' and 'about' next to each other in the exactText
  field
  AND
  have the term 'tomorrow' in the content field
  OR
  have the term 'morning' in the text field

To fix it to what you want, I think you need to do:

 q=exactText:"how+about" AND content:(tomorrow AND morning)

I believe you can get rid of the ANDs from your query with:

q.op=AND&q=exactText:"how+about" content:(tomorrow morning)

Upayavira

On Fri, Dec 21, 2012, at 09:37 AM, xpow wrote:
> Hi,
> 
> I have a case where i need to find the results of a query that search for
> a
> exact phrase + other words, for example, if i have a keyword like:
> 
> "how about" tomorrow morning
> 
> the results that should be fetched should match these criteria:
> - containing exact phrase how about <= exactly how about
> - containing word tomorrow
> - containing word morning
> 
> Can anybody explain to me how to do this? I tried:
> q=exactText:"how+about" AND content:tomorrow+morning
> q=exactText:"how+about" AND _query_:"{!dismax qf=content pf=content
> v=$qq}"&qq=tomorrow+morning
> 
> but the results that i got:
> (1) documents always contain phrase "how about" plus tomorrow
> (2) documents always contain phrase "how about" plus morning
> (3) documents always contain phrase "how about" plus tomorrow and morning
> 
> the correct results should only be (3), please help, thanks ...
> 
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-3-6-1-tp4028502.html
> Sent from the Solr - User mailing list archive at Nabble.com.