Conditional N-gram token filter?

Could we have conditional N-gram token filter? Tell me yes or no ?

More explanation : I have a text "The animal is cute"
I want to know if it is possible to have min_gram=3 if word.length>=3
and min_gram=2 if word.length< 3 ?!

Invert-indexing all tokens/words with min_gram=2 could have many cost on server and min_gram=3 results in missing some small words in Persian.
Any hint is appreciable

I would be so thankful if your answer is yes, give me an example.
This is my current code using Nest and I need to know if I can change N-gram token filter for different words

         var suggestionindexResponse = await client.Indices.CreateAsync("suggestionindex", c => c
                .Settings(s => s
                .Setting(UpdatableIndexSettings.MaxNGramDiff, 8)
                .Analysis(a => a
                .CharFilters(cf => cf.Mapping("mycharfilter", cf => cf.Mappings(new[] { "\\u200C=>\\u0020" })))    //convert somthing like half space (Ctrl + -   or shift+ctrl+4) to space                 
                .Analyzers(aa => aa
                .Custom("suggestionanalyzer", ca => ca
                .Filters(new List<string> { "lowercase", "my_stopword", "mynGram", "decimal_digit", "arabic_normalization", "persian_normalization" })
                .Custom("suggestionsearchanalyzer", ca => ca
                .Filters(new List<string> { "lowercase", "my_stopword", "decimal_digit", "arabic_normalization", "persian_normalization" })
                .TokenFilters(tf => tf
                .Stop("my_stopword", st => st.StopWords("_persian_"))
                .NGram("mynGram", td => td
                .Map<WordSuggestion>(m => m
                  .Properties(ps => ps
                  .Text(s => s.Name(n => n.word).Analyzer("suggestionanalyzer").SearchAnalyzer("suggestionsearchanalyzer"))
                  .Number(n => n.Name(i => i.Id).Type(NumberType.Integer))

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.