[
https://issues.apache.org/jira/browse/SOLR-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492429
]
Michael Pelz-Sherman commented on SOLR-218:
-------------------------------------------
I just don't see how it's possible for Solr to "figure out the right thing to
do automatically" in every case.
Even if this were possible, I don't see how it harms Solr to offer access to
these configuration parameters. Whether this is done through the solrconfig.xml
or the schema.xml isn't really important to me; I would just like to have some
way of adjusting these parameters without having to write a plugin. If it can
be a per-field setting, great, but it's nice to have a global setting as well.
As for setLowercaseExpandedTerms(), it seems to me that Solr should not
override the default settings provided by Lucene without a very solid reason.
For such a young product, I question whether backward compatibility is a valid
justification for doing so.
Anyway, thanks very much for considering this. Meanwhile, I will look at
writing a plugin so I can get the functionality I need without having to modify
the Solr source.
> 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
>
> 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.