1

I'm trying to implement an analyzer and tokenizer on my created custom field type. Any ideas on how to implement it?

example:- I have created one custom field type like wtbngramscase in solr schema but I want to create a tokenizer and analyzer using c# code, is there any way to implement it?

<fieldType name="wtbngramscase" class="solr.TextField" positionIncrementGap="100" multiValued="false">
<analyzer Type="index">
<tokenizer class="solr.StandardTokenizerFactory" />
<filters class="solr.StopFilterFactory" words="stopwords.txt" ignorecase="true" />
<filters class="solr.EdgeNGramTokenizerFactory" mingramsize="1" maxgramsize="70" />
<filters class="solr.LowerCaseFilterFactory" />
</analyzer>
<analyzer Type="query">
<tokenizer class="solr.StandardTokenizerFactory" />
<filters class="solr.StopFilterFactory" words="stopwords.txt" ignorecase="true" />
<filters class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt" />
<filters class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>

Any help will be greatly appreciated.

1 Answer 1

0

The analyzers and tokenizers are defined in the managed-schema file present in the indexname/conf path where all the Solr cores are present (See attached image)

enter image description here

So to add your custom fieldtype, you may create a custom index instead of adding it to existing Sitecore indexes. Navigate to the managed-schema file and include your change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.