Unfortunately, the current out-of-the-box defaults (example config)
for Solr are a disaster for non-whitespace languages (CJK, Thai,
etc.), ie, exactly what you've hit.

This is because Lucene's QueryParser can unexpectedly, dangerously,
create PhraseQuery even when the user did not ask for it ("auto
phrase").  Not only does this mean no results for non-whitespace
languages, but it also means worse search performance (PhraseQuery is
usually more costly than TermQuerys).

Lucene leaves this "auto phrase" behavior off by default, but Solr
defaults it to on.

Robert's email gives a good description of how you can turn it off.

The very first thing every non-whitespace language Solr app should do
is turn  off autoGeneratePhraseQueries!

Mike

http://blog.mikemccandless.com

On Wed, May 4, 2011 at 8:21 PM, cyang2010 <ysxsu...@hotmail.com> wrote:
> Hi,
>
> In solr admin query full interface page, the following query with english
> become term query according to debug :
>
> title_en_US: (blood red)
>
> <lst name="debug">
> <str name="rawquerystring">title_en_US: (blood red)</str>
> <str name="querystring">title_en_US: (blood red)</str>
> <str name="parsedquery">title_en_US:blood title_en_US:red</str>
> <str name="parsedquery_toString">title_en_US:blood title_en_US:red</str>
>
>
> However, using the same syntax with two chinese terms, the query result into
> a phrase query:
>
> title_zh_CN: (我活)
>
> <lst name="debug">
> <str name="rawquerystring">title_zh_CN: (我活)</str>
> <str name="querystring">title_zh_CN: (我活)</str>
> <str name="parsedquery">PhraseQuery(title_zh_CN:"我 活")</str>
> <str name="parsedquery_toString">title_zh_CN:"我 活"</str>
>
>
> I do have different tokenizer/filter for those two different fields.
> title_en_US is using all those common english specific tokenizer, while
> title_zh_CN uses solr.ChineseTokenizerFactory.
>
> I don't think those tokenizer determin whether things within bracket become
> term queries or phrase queries.
>
> I really need to blindly pass user-input text to a solr field without doing
> any parsing, and hope it is all doing term query for each term contained in
> the search text.
>
> How do i achieve that?
>
> Thanks,
>
>
> cy
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/why-query-chinese-character-with-bracket-become-phrase-query-by-default-tp2901542p2901542.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to