Question

PatternReplaceFilterFactory not working with wildcard search.

Example:

<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement="" replace="all"/>

Search with q=defaultsearch:*ab12cd*, expected to give the result for the word *abcd* but it is not working.

Can you please suggest me, is there any way to achieve this functionality?

Was it helpful?

Solution

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Analyzers mentions -

On wildcard and fuzzy searches, no text analysis is performed on the search word.

So the search query will not undergo any analysis during query time.
Hence the pattern replace filter will not be applicable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top