I'm trying to work out how to set the text analyzer for a search query in Solr (8.11.1)
Here is my handler set in solrconfig.xml
:
<requestHandler name="/select" class="solr.SearchHandler">
<!-- default values for query parameters can be specified, these
will be overridden by parameters in the request
-->
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">100</int>
<int name="qs">8</int>
</lst>
</requestHandler>
What I want to do is be able to use this field type to do the search: (this is set in managed-schema.xml
)
<fieldType name="synonymized" class="solr.TextField">
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" format="solr" ignoreCase="true" expand="true" tokenizerFactory="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="(_)" replacement=" " replace="all"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
</analyzer>
</fieldType>
How do I go about that? For Solr 6.6 (our old server), we used this plugin: https://github.com/o19s/match-query-parser , and then passed in analyze_as=synonymized
, but unfortunatly that plugin doesn't seem to work on Solr 8.11.1
Hopefully that makes sense! Please ask if you need clarification on anything (Solr is a complex beast, and I'm still trying to get my head around some of it!)