My code is as below:
SolrQuery query = new SolrQuery();
query.setQuery(q.trim());
try {
QueryResponse res = getSolrServer().query(query);
return res.getResults();
} catch (SolrServerException sse) {
log.error(sse);
}
The problem is that when i have a query more then 3 characters this returns me the response, e.g. query string "che" would respond with results, however the query string "ch" would return me no response. Is there a way i can override the 3 character min length of Solr Query.
is the below xml causing the problem, if yes can i programmatically override it using java
<analyzer type="index">
<tokenizer class="solr.NGramTokenizerFactory" minGramSize="3" maxGramSize="50" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
Appreciate the help in Advance.
Thanks and Regards,
Vaibhav