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 akinori <ak...@gmail.com> on 2009/06/30 19:09:15 UTC

Search for phrase including prepositions

I indexed English dictionary to solr.
When I search "apple juice" for example, solr understands the query is
"apple" & "juice" as what I want. Howerver, when I search "apple for", solr
thinks that the query is just "apple". 
How can I solve this? I think I have to understand the analyzer. Could
anyone navigate me?

Akinori
-- 
View this message in context: http://www.nabble.com/Search-for-phrase-including-prepositions-tp24275909p24275909.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Search for phrase including prepositions

Posted by Michael Ludwig <ml...@as-guides.com>.
akinori schrieb:
> When I search "make for", solr returns words include both "make" and
> "for", but when I type more than 3 words such as "in order to", the
> result becomes 0 though the index is sure to have several words
> including 3 of the words. 2 words are ok but more than 3 words
> resulted zero. Why is happens?

Hi Akinori,

I guess you're using the DisMax query parser. Please read this entire
page: http://wiki.apache.org/solr/DisMaxRequestHandler

The parameter that allows you to tweak this is the "mm" parameter.

Michael Ludwig

Re: Search for phrase including prepositions

Posted by akinori <ak...@gmail.com>.
Ludwig,

Thank you for your prompt answer and I could solve the issue.

Then I have another question.
When I search "make for", solr returns words include both "make" and "for",
but when I type more than 3 words such as "in order to", the result becomes
0 though the index is sure to have several words including 3 of the words. 2
words are ok but more than 3 words resulted zero. Why is happens?

Best,




Michael Ludwig-4 wrote:
> 
> akinori schrieb:
>> I indexed English dictionary to solr.
>> When I search "apple juice" for example, solr understands the query is
>> "apple" & "juice" as what I want. Howerver, when I search "apple for",
>> solr thinks that the query is just "apple".
>> How can I solve this? I think I have to understand the analyzer.
> 
> Exactly.
> 
>> Could anyone navigate me?
> 
> Go to your analysis page, enter your field name (or type), check
> "verbose output", enter your query, and press "Analyze".
> 
> http://localhost:8983/solr/admin/analysis.jsp
> 
> You'll probably find that the word "for" is removed as a so-called
> stopword.
> 
> Michael Ludwig
> 
> 

-- 
View this message in context: http://www.nabble.com/Search-for-phrase-including-prepositions-tp24275909p24276312.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Search for phrase including prepositions

Posted by Michael Ludwig <ml...@as-guides.com>.
akinori schrieb:
> I indexed English dictionary to solr.
> When I search "apple juice" for example, solr understands the query is
> "apple" & "juice" as what I want. Howerver, when I search "apple for",
> solr thinks that the query is just "apple".
> How can I solve this? I think I have to understand the analyzer.

Exactly.

> Could anyone navigate me?

Go to your analysis page, enter your field name (or type), check
"verbose output", enter your query, and press "Analyze".

http://localhost:8983/solr/admin/analysis.jsp

You'll probably find that the word "for" is removed as a so-called
stopword.

Michael Ludwig