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 "Zhang, Lisheng" <Li...@BroadVision.com> on 2013/02/08 21:20:16 UTC

Solr query parser, needs to call setAutoGeneratePhraseQueries(true)

Hi,

In our application we need to call method

setAutoGeneratePhraseQueries(true)

on lucene QueryParser, this is the way used to work in earlier versions
and it seems to me that is the much natural way?

But in current solr 3.6.1, the only way to do so is to set 

<luceneMatchVersion>LUCENE_30</luceneMatchVersion>

in solrconfig.xml (if I read souce code correctly), but I donot want to 
do so because this will change the whole behavior of lucene, and I only 
want to change this query parser behavior, not other lucene features?

Please guide me if there is a better way other than to change solr source
code?

Thanks very much for helps, Lisheng

Re: Solr query parser, needs to call setAutoGeneratePhraseQueries(true)

Posted by Jack Krupansky <ja...@basetechnology.com>.
Simply add the "autoGeneratePhraseQueries" attribute with a value of "true" 
to all of your "text" field types in your schema.xml.

See the text_




-- Jack Krupansky
-----Original Message----- 
From: Zhang, Lisheng
Sent: Friday, February 08, 2013 3:20 PM
To: solr-user@lucene.apache.org
Subject: Solr query parser, needs to call setAutoGeneratePhraseQueries(true)


Hi,

In our application we need to call method

setAutoGeneratePhraseQueries(true)

on lucene QueryParser, this is the way used to work in earlier versions
and it seems to me that is the much natural way?

But in current solr 3.6.1, the only way to do so is to set

<luceneMatchVersion>LUCENE_30</luceneMatchVersion>

in solrconfig.xml (if I read souce code correctly), but I donot want to
do so because this will change the whole behavior of lucene, and I only
want to change this query parser behavior, not other lucene features?

Please guide me if there is a better way other than to change solr source
code?

Thanks very much for helps, Lisheng 


RE: Solr query parser, needs to call setAutoGeneratePhraseQueries(true)

Posted by "Zhang, Lisheng" <Li...@BroadVision.com>.
Thanks very much, it worked perfectly !!

Best regards, Lisheng

-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com]
Sent: Friday, February 08, 2013 1:04 PM
To: solr-user@lucene.apache.org
Subject: Re: Solr query parser, needs to call
setAutoGeneratePhraseQueries(true)


(Sorry for my split message)...

See the text_en_splitting field type for an example:

<fieldType name="text_en_splitting" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
...

-- Jack Krupansky

-----Original Message----- 
From: Zhang, Lisheng
Sent: Friday, February 08, 2013 3:20 PM
To: solr-user@lucene.apache.org
Subject: Solr query parser, needs to call setAutoGeneratePhraseQueries(true)


Hi,

In our application we need to call method

setAutoGeneratePhraseQueries(true)

on lucene QueryParser, this is the way used to work in earlier versions
and it seems to me that is the much natural way?

But in current solr 3.6.1, the only way to do so is to set

<luceneMatchVersion>LUCENE_30</luceneMatchVersion>

in solrconfig.xml (if I read souce code correctly), but I donot want to
do so because this will change the whole behavior of lucene, and I only
want to change this query parser behavior, not other lucene features?

Please guide me if there is a better way other than to change solr source
code?

Thanks very much for helps, Lisheng 


Re: Solr query parser, needs to call setAutoGeneratePhraseQueries(true)

Posted by Jack Krupansky <ja...@basetechnology.com>.
(Sorry for my split message)...

See the text_en_splitting field type for an example:

<fieldType name="text_en_splitting" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
...

-- Jack Krupansky

-----Original Message----- 
From: Zhang, Lisheng
Sent: Friday, February 08, 2013 3:20 PM
To: solr-user@lucene.apache.org
Subject: Solr query parser, needs to call setAutoGeneratePhraseQueries(true)


Hi,

In our application we need to call method

setAutoGeneratePhraseQueries(true)

on lucene QueryParser, this is the way used to work in earlier versions
and it seems to me that is the much natural way?

But in current solr 3.6.1, the only way to do so is to set

<luceneMatchVersion>LUCENE_30</luceneMatchVersion>

in solrconfig.xml (if I read souce code correctly), but I donot want to
do so because this will change the whole behavior of lucene, and I only
want to change this query parser behavior, not other lucene features?

Please guide me if there is a better way other than to change solr source
code?

Thanks very much for helps, Lisheng