RE: svn commit: r978879 - /lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.java

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: svn commit: r978879 - /lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.java

Uwe Schindler
Hi Yonik,

i would prefer to pass the default QP version constant tot he ctor and simply switch on the auto-phrase building per default:

super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion", Version.LUCENE_24), defaultField == null ? schema.getDefaultSearchFieldName() : defaultField, schema.getQueryAnalyzer());
setAutoGeneratePhraseQueries(true);

This is cleaner, as there may (an I think there are other things changed dependent on version?)

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [hidden email]


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Saturday, July 24, 2010 4:39 PM
> To: [hidden email]
> Subject: svn commit: r978879 -
> /lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.ja
> va
>
> Author: yonik
> Date: Sat Jul 24 14:38:58 2010
> New Revision: 978879
>
> URL: http://svn.apache.org/viewvc?rev=978879&view=rev
> Log:
> LUCENE-2458: keep Solr's default QP behavior wrt compound words and
> phrases
>
> Modified:
>
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a
>
> Modified:
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/s
> olr/search/SolrQueryParser.java?rev=978879&r1=978878&r2=978879&view=
> diff
> ==========================================================
> ====================
> ---
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a (original)
> +++
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a Sat Jul 24 14:38:58 2010
> @@ -73,7 +73,7 @@ public class SolrQueryParser extends Que
>     * @see IndexSchema#getDefaultSearchFieldName()
>     */
>    public SolrQueryParser(IndexSchema schema, String defaultField) {
> -    super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion",
> Version.LUCENE_24), defaultField == null ?
> schema.getDefaultSearchFieldName() : defaultField,
> schema.getQueryAnalyzer());
> +    super(Version.LUCENE_24, defaultField == null ?
> schema.getDefaultSearchFieldName() : defaultField,
> schema.getQueryAnalyzer());
>      this.schema = schema;
>      this.parser  = null;
>      this.defaultField = defaultField;
> @@ -87,7 +87,7 @@ public class SolrQueryParser extends Que
>    }
>
>    public SolrQueryParser(QParser parser, String defaultField, Analyzer
> analyzer) {
> -
> super(parser.getReq().getSchema().getSolrConfig().getLuceneVersion("luce
> neMatchVersion", Version.LUCENE_24), defaultField, analyzer);
> +    super(Version.LUCENE_24, defaultField, analyzer);
>      this.schema = parser.getReq().getSchema();
>      this.parser = parser;
>      this.defaultField = defaultField;
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r978879 - /lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.java

Yonik Seeley-2-2
On Sat, Jul 24, 2010 at 11:30 AM, Uwe Schindler <[hidden email]> wrote:
> Hi Yonik,
>
> i would prefer to pass the default QP version constant tot he ctor and simply switch on the auto-phrase building per default:
>
> super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion", Version.LUCENE_24), defaultField == null ? schema.getDefaultSearchFieldName() : defaultField, schema.getQueryAnalyzer());
> setAutoGeneratePhraseQueries(true);
>
> This is cleaner, as there may (an I think there are other things changed dependent on version?)

Yeah, we could change it to do that... I just used the
Version.LUCENE_24 since that's what it was set to before LUCENE-2458
was committed.

It won't currently make a functional difference (Solr always
explicitly enabled position increments anyway), but I agree your way
is cleaner.

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r978879 - /lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.java

Robert Muir
In reply to this post by Uwe Schindler
I dont think we should do any of this.

but if you are going to do it (which clearly you will regardless of anyone elses opinion), set the default version to LUCENE_24 in *SOLRCONFIG.XML* so that people who want to use the 3.1 defaults can, dont hardcode versions or options.

On Sat, Jul 24, 2010 at 11:30 AM, Uwe Schindler <[hidden email]> wrote:
Hi Yonik,

i would prefer to pass the default QP version constant tot he ctor and simply switch on the auto-phrase building per default:

super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion", Version.LUCENE_24), defaultField == null ? schema.getDefaultSearchFieldName() : defaultField, schema.getQueryAnalyzer());
setAutoGeneratePhraseQueries(true);

This is cleaner, as there may (an I think there are other things changed dependent on version?)

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [hidden email]


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Saturday, July 24, 2010 4:39 PM
> To: [hidden email]
> Subject: svn commit: r978879 -
> /lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.ja
> va
>
> Author: yonik
> Date: Sat Jul 24 14:38:58 2010
> New Revision: 978879
>
> URL: http://svn.apache.org/viewvc?rev=978879&view=rev
> Log:
> LUCENE-2458: keep Solr's default QP behavior wrt compound words and
> phrases
>
> Modified:
>
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a
>
> Modified:
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/s
> olr/search/SolrQueryParser.java?rev=978879&r1=978878&r2=978879&view=
> diff
> ==========================================================
> ====================
> ---
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a (original)
> +++
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrQueryParser.jav
> a Sat Jul 24 14:38:58 2010
> @@ -73,7 +73,7 @@ public class SolrQueryParser extends Que
>     * @see IndexSchema#getDefaultSearchFieldName()
>     */
>    public SolrQueryParser(IndexSchema schema, String defaultField) {
> -    super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion",
> Version.LUCENE_24), defaultField == null ?
> schema.getDefaultSearchFieldName() : defaultField,
> schema.getQueryAnalyzer());
> +    super(Version.LUCENE_24, defaultField == null ?
> schema.getDefaultSearchFieldName() : defaultField,
> schema.getQueryAnalyzer());
>      this.schema = schema;
>      this.parser  = null;
>      this.defaultField = defaultField;
> @@ -87,7 +87,7 @@ public class SolrQueryParser extends Que
>    }
>
>    public SolrQueryParser(QParser parser, String defaultField, Analyzer
> analyzer) {
> -
> super(parser.getReq().getSchema().getSolrConfig().getLuceneVersion("luce
> neMatchVersion", Version.LUCENE_24), defaultField, analyzer);
> +    super(Version.LUCENE_24, defaultField, analyzer);
>      this.schema = parser.getReq().getSchema();
>      this.parser = parser;
>      this.defaultField = defaultField;
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Robert Muir
[hidden email]