You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Uwe Schindler <uw...@thetaphi.de> on 2010/07/24 17:30:39 UTC

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

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: uwe@thetaphi.de


> -----Original Message-----
> From: yonik@apache.org [mailto:yonik@apache.org]
> Sent: Saturday, July 24, 2010 4:39 PM
> To: commits@lucene.apache.org
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


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

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Sat, Jul 24, 2010 at 11:30 AM, Uwe Schindler <uw...@thetaphi.de> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


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

Posted by Robert Muir <rc...@gmail.com>.
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 <uw...@thetaphi.de> 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: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: yonik@apache.org [mailto:yonik@apache.org]
> > Sent: Saturday, July 24, 2010 4:39 PM
> > To: commits@lucene.apache.org
> > 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: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>


-- 
Robert Muir
rcmuir@gmail.com