Search code examples
elasticsearchfull-text-indexing

Is it possible to implement a token filter chain in elastic search with an UNDO step?


I need a token filter chain for these filter rules: * Remove all stopwords * If the token list is now empty, then restore the stop words

Reason: I have to find, for example, the book "It" by Steven King.

Any guidance help very much appreciated.


Solution

  • Use a synonym filter to change it to _it_ for example: it => _it_ and at searching time you use an analyzer that uses the same synonym filter.