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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top