You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Jonas Salk (JIRA)" <ji...@apache.org> on 2009/04/20 15:55:47 UTC
[jira] Issue Comment Edited: (SOLR-218) Support for Lucene
QueryParser properties via solrconfig.xml file
[ https://issues.apache.org/jira/browse/SOLR-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700793#action_12700793 ]
Jonas Salk edited comment on SOLR-218 at 4/20/09 6:54 AM:
----------------------------------------------------------
That is good to hear Mark. Would you mind taking a few minutes and putting down exact code changes you made? I want to backtrack everything i did to ensure, I've not made some mistakes. I've basically updated only one Java file: SolrQueryParser.java.
I'm using: apache-solr-1.3.0
Jonas
SolrQueryParser.java
------------------------------
public SolrQueryParser(IndexSchema schema, String defaultField) {
...
// added
setAllowLeadingWildcard(true);
setLowercaseExpandedTerms(true);
...
}
...
public SolrQueryParser(QParser parser, String defaultField, Analyzer analyzer)
{
...
setAllowLeadingWildcard(true);
setLowercaseExpandedTerms(true);
...
}
was (Author: jonas3000):
That is good to hear Mark. Would you mind taking a few minutes and putting down exact code changes you made? I want to backtrack everything i did to ensure, I've not made some mistakes. I've basically updated only one Java file:
Jonas
SolrQueryParser.java
------------------------------
public SolrQueryParser(IndexSchema schema, String defaultField) {
...
// added
setAllowLeadingWildcard(true);
setLowercaseExpandedTerms(true);
...
}
...
public SolrQueryParser(QParser parser, String defaultField, Analyzer analyzer)
{
...
setAllowLeadingWildcard(true);
setLowercaseExpandedTerms(true);
...
}
> Support for Lucene QueryParser properties via solrconfig.xml file
> -----------------------------------------------------------------
>
> Key: SOLR-218
> URL: https://issues.apache.org/jira/browse/SOLR-218
> Project: Solr
> Issue Type: Improvement
> Components: search
> Affects Versions: 1.1.0
> Reporter: Michael Pelz-Sherman
> Fix For: 1.5
>
>
> The SolrQueryParser class, which extends Lucene's QueryParser class, does not provide any way of setting the various QueryParser properties via the solr config file (solrconfig.xml). These properties include:
> allowLeadingWildcard (Set to true to allow * and ? as the first character of a PrefixQuery and WildcardQuery)
> dateResolution: Sets the default date resolution used by RangeQueries for fields for which no specific date resolutions has been set.
> defaultOperator: Sets the boolean operator of the QueryParser.
> fuzzyMinSim: Set the minimum similarity for fuzzy queries.
> locale: Set locale used by date range parsing.
> lowercaseExpandedTerms: Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not.
> phraseSlop: Sets the default slop for phrases.
> useOldRangeQuery: By default QueryParser uses new ConstantScoreRangeQuery in preference to RangeQuery for range queries.
> This can be achieved by calling the setter methods for these properties in the SolrQueryParser constructor,
> public SolrQueryParser(IndexSchema schema, String defaultField) {
> super(defaultField == null ? schema.getDefaultSearchFieldName() : defaultField, schema.getQueryAnalyzer());
> this.schema = schema;
> setAllowLeadingWildcard(SolrConfig.config.getBool("query/setAllowLeadingWildcard"));
> setLowercaseExpandedTerms(SolrConfig.config.getBool("query/lowerCaseExpandedTerms"));
> }
> In addition, solr should not modify these values from the defaults provided by Lucene, as it currently does by calling setLowercaseExpandedTerms(false) in this method.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.