QueryParser.setAutoGeneratePhraseQueries()

Hi,

I wonder if QueryParser.setAutoGeneratePhraseQueries() is exposed through
API.
From Lucene 3.1, the default value of AutoGeneratePhraseQueries becomes
"false" for some reason. It breaks CJK queries. To make CJK queries to work,
we need to call QueryParser.setAutoGeneratePhraseQueries(true).

If it's not possible, can I open a ticket for it?

Thanks,
Iori

I think setting this to "true" breaks CJK queries... eg see
http://markmail.org/thread/ww6mhfi3rfpngmc5

It was changed to "false" by default in Lucene (see
[LUCENE-2458] queryparser makes all CJK queries phrase queries regardless of analyzer - ASF JIRA ) to not break CJK
queries.

But I agree this setting should be controllable via ES.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 12:40 AM, Iori haseori@gmail.com wrote:

Hi,
I wonder if QueryParser.setAutoGeneratePhraseQueries() is exposed through
API.
From Lucene 3.1, the default value of AutoGeneratePhraseQueries becomes
"false" for some reason. It breaks CJK queries. To make CJK queries to work,
we need to call QueryParser.setAutoGeneratePhraseQueries(true).
If it's not possible, can I open a ticket for it?

Thanks,
Iori

Hi,

"break" might not be right word. It is "break" for us, though.
It doesn't return the same result as previous version and we need
QueryParser to behave the same as 3.0.

Anyway, I will create a ticket.

Iori

2011/5/24 Michael McCandless mail@mikemccandless.com

I think setting this to "true" breaks CJK queries... eg see
http://markmail.org/thread/ww6mhfi3rfpngmc5

It was changed to "false" by default in Lucene (see
[LUCENE-2458] queryparser makes all CJK queries phrase queries regardless of analyzer - ASF JIRA ) to not break CJK
queries.

But I agree this setting should be controllable via ES.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 12:40 AM, Iori haseori@gmail.com wrote:

Hi,
I wonder if QueryParser.setAutoGeneratePhraseQueries() is exposed through
API.
From Lucene 3.1, the default value of AutoGeneratePhraseQueries becomes
"false" for some reason. It breaks CJK queries. To make CJK queries to
work,
we need to call QueryParser.setAutoGeneratePhraseQueries(true).
If it's not possible, can I open a ticket for it?

Thanks,
Iori

Yea, this field is not exposed in ES, open an issue, easy to expose.
On Tuesday, May 24, 2011 at 2:36 PM, Iori wrote:

Hi,

"break" might not be right word. It is "break" for us, though.
It doesn't return the same result as previous version and we need QueryParser to behave the same as 3.0.

Anyway, I will create a ticket.

Iori

2011/5/24 Michael McCandless mail@mikemccandless.com

I think setting this to "true" breaks CJK queries... eg see
http://markmail.org/thread/ww6mhfi3rfpngmc5

It was changed to "false" by default in Lucene (see
[LUCENE-2458] queryparser makes all CJK queries phrase queries regardless of analyzer - ASF JIRA ) to not break CJK
queries.

But I agree this setting should be controllable via ES.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 12:40 AM, Iori haseori@gmail.com wrote:

Hi,
I wonder if QueryParser.setAutoGeneratePhraseQueries() is exposed through
API.
From Lucene 3.1, the default value of AutoGeneratePhraseQueries becomes
"false" for some reason. It breaks CJK queries. To make CJK queries to work,
we need to call QueryParser.setAutoGeneratePhraseQueries(true).
If it's not possible, can I open a ticket for it?

Thanks,
Iori

Ahh, OK, makes sense.

You (or ES) could also pass Version.LUCENE_30 as the "matchVersion"
param to QueryParser.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 7:36 AM, Iori haseori@gmail.com wrote:

Hi,
"break" might not be right word. It is "break" for us, though.
It doesn't return the same result as previous version and we need
QueryParser to behave the same as 3.0.
Anyway, I will create a ticket.

Iori
2011/5/24 Michael McCandless mail@mikemccandless.com

I think setting this to "true" breaks CJK queries... eg see
http://markmail.org/thread/ww6mhfi3rfpngmc5

It was changed to "false" by default in Lucene (see
[LUCENE-2458] queryparser makes all CJK queries phrase queries regardless of analyzer - ASF JIRA ) to not break CJK
queries.

But I agree this setting should be controllable via ES.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 12:40 AM, Iori haseori@gmail.com wrote:

Hi,
I wonder if QueryParser.setAutoGeneratePhraseQueries() is exposed
through
API.
From Lucene 3.1, the default value of AutoGeneratePhraseQueries becomes
"false" for some reason. It breaks CJK queries. To make CJK queries to
work,
we need to call QueryParser.setAutoGeneratePhraseQueries(true).
If it's not possible, can I open a ticket for it?

Thanks,
Iori

Hi,

Yes, actually I ended up re-setting org.elasticsearch.common.lucene.Lucene.QUERYPARSER_VERSION using reflection.
But it looks I don't need it any more since this is already implemented :slight_smile:

Iori
On Tuesday, May 24, 2011 at 14:33 , Michael McCandless wrote:
Ahh, OK, makes sense.

You (or ES) could also pass Version.LUCENE_30 as the "matchVersion"
param to QueryParser.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 7:36 AM, Iori haseori@gmail.com wrote:

Hi,
"break" might not be right word. It is "break" for us, though.
It doesn't return the same result as previous version and we need
QueryParser to behave the same as 3.0.
Anyway, I will create a ticket.

Iori
2011/5/24 Michael McCandless mail@mikemccandless.com

I think setting this to "true" breaks CJK queries... eg see
http://markmail.org/thread/ww6mhfi3rfpngmc5

It was changed to "false" by default in Lucene (see
[LUCENE-2458] queryparser makes all CJK queries phrase queries regardless of analyzer - ASF JIRA ) to not break CJK
queries.

But I agree this setting should be controllable via ES.

Mike

http://blog.mikemccandless.com

On Tue, May 24, 2011 at 12:40 AM, Iori haseori@gmail.com wrote:

Hi,
I wonder if QueryParser.setAutoGeneratePhraseQueries() is exposed
through
API.
From Lucene 3.1, the default value of AutoGeneratePhraseQueries becomes
"false" for some reason. It breaks CJK queries. To make CJK queries to
work,
we need to call QueryParser.setAutoGeneratePhraseQueries(true).
If it's not possible, can I open a ticket for it?

Thanks,
Iori