Hi all,
If user do wildcard query and the term has upper case (like Hell*), the query
will not return result.
I saw in org.apache.lucene.queryParser.QueryParser has function
setLowercaseExpandedTerms to handle this.
Via comments, looks like default value should be true.
But in SolrQueryParser, it hardcode this value to false.
I was wondering why SolrQueryParser set it to false by default?
org.apache.lucene.queryParser.QueryParser
/**
* Whether terms of wildcard, prefix, fuzzy and range queries are to be
automatically
* lower-cased or not. Default is <code>true</code>.
*/
public void setLowercaseExpandedTerms(boolean lowercaseExpandedTerms) {
this.lowercaseExpandedTerms = lowercaseExpandedTerms;
}
org.apache.solr.search.SolrQueryParser
public SolrQueryParser(IndexSchema schema, String defaultField) {
super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion",
Version.LUCENE_24), defaultField == null ? schema.getDefaultSearchFieldName() :
defaultField, schema.getQueryAnalyzer());
this.schema = schema;
this.parser = null;
this.defaultField = defaultField;
setLowercaseExpandedTerms(false);
setEnablePositionIncrements(true);
checkAllowLeadingWildcards();
}
Thanks,
Yongtao
******************Legal Disclaimer***************************
"This communication may contain confidential and privileged
material for the sole use of the intended recipient. Any
unauthorized review, use or distribution by others is strictly
prohibited. If you have received the message in error, please
advise the sender by reply email and delete the message. Thank
you."
*********************************************************