Wildcard queries and custom char filter
Hello, I have a problem with configuring custom char filter. When there are no wildcards in query then my filter is invoked. When there are wildcards, my filter is not invoked. It is possible to configure charFilter to be used with wildcard queries? I can see than with wildcards, TokenizerChain.charFilters is null. configuration: analyzer type=query charFilter class=a.b.c.MyFilterFactory / tokenizer class=solr.StandardTokenizerFactory/ filter class=solr.LowerCaseFilterFactory/ /analyzer What is more interesting, I can see that solr.LowerCaseFilterFactory is invoked even with wildcards. I tried to transform charFilter to normal Filter but the result is the same (it is not invoked with wildcards). Best -- View this message in context: http://lucene.472066.n3.nabble.com/Wildcard-queries-and-custom-char-filter-tp4107241.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Wildcard queries and custom char filter
Hi, Yes some factories implement org.apache.lucene.analysis.util.MultiTermAwareComponent Please see more http://wiki.apache.org/solr/MultitermQueryAnalysis On Wednesday, December 18, 2013 1:05 PM, michallos michal.ware...@gmail.com wrote: Hello, I have a problem with configuring custom char filter. When there are no wildcards in query then my filter is invoked. When there are wildcards, my filter is not invoked. It is possible to configure charFilter to be used with wildcard queries? I can see than with wildcards, TokenizerChain.charFilters is null. configuration: analyzer type=query charFilter class=a.b.c.MyFilterFactory / tokenizer class=solr.StandardTokenizerFactory/ filter class=solr.LowerCaseFilterFactory/ /analyzer What is more interesting, I can see that solr.LowerCaseFilterFactory is invoked even with wildcards. I tried to transform charFilter to normal Filter but the result is the same (it is not invoked with wildcards). Best -- View this message in context: http://lucene.472066.n3.nabble.com/Wildcard-queries-and-custom-char-filter-tp4107241.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Wildcard queries and custom char filter
It works! Thanks. Last question: how to invoke charFilter before tokenizer? I can see that with tokenizer StandardTokenizerFactory without wildcards text 123-abc is broken into two tokens 123 and abc but text *123-abc* remain unchanged *123-abc*. It is possible to use charFilter before tokenizers? -- View this message in context: http://lucene.472066.n3.nabble.com/Wildcard-queries-and-custom-char-filter-tp4107241p4107252.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Wildcard queries and custom char filter
Hoh, I can see that when there are wildcards then KeywordTokenizerFactory is used instead of StandardTokenizerFactory. I created custom wildcard remover char filter for few specific cases (so I cannot use any of regex replacer filters) but event with that, KeywordTokenizerFactory is used. I thought charFilter is enough but there is more complicated logic in SolrQueryParserBase#handleBareTokenQuery that chooses KeywordTokenizerFactory before my charFilter is invoked! Is it possible to handle custom wildcard remover, so that StandardTokenizerFactory may be used? -- View this message in context: http://lucene.472066.n3.nabble.com/Wildcard-queries-and-custom-char-filter-tp4107241p4107275.html Sent from the Solr - User mailing list archive at Nabble.com.