# Plugin that can intersect an automaton with the completion suggester FSTs

**URL:** <https://discuss.elastic.co/t/plugin-that-can-intersect-an-automaton-with-the-completion-suggester-fsts/215908>\
**Category:** Elasticsearch\
**Created:** [January 21, 2020, 3:35pm UTC](https://discuss.elastic.co/t/plugin-that-can-intersect-an-automaton-with-the-completion-suggester-fsts/215908 "2020-01-21T15:35:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luk.morbee](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@luk.morbee](https://discuss.elastic.co/u/luk.morbee)\
**Post date:** [January 21, 2020, 3:35pm UTC](https://discuss.elastic.co/t/plugin-that-can-intersect-an-automaton-with-the-completion-suggester-fsts/215908/1 "2020-01-21T15:35:08Z")

</div>

If I understood it correctly an FST is created per segment for every completion suggester.  
Suppose we would want to write an Elasticsearch plugin that would allow us to intersect a given automaton (i.e. search logic you can’t express with a regular expression) with these FSTs, where can I (having no knowledge of the inner workings of Elasticsearch) find some sample code (or other information) to access these FSTs created by Elasticsearch.

---

<div class="post-metadata">

**Author:** ![luk.morbee](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@luk.morbee](https://discuss.elastic.co/u/luk.morbee)\
**Post date:** [January 23, 2020, 8:54am UTC](https://discuss.elastic.co/t/plugin-that-can-intersect-an-automaton-with-the-completion-suggester-fsts/215908/2 "2020-01-23T08:54:33Z")

</div>

I think I found it: [CompletionSuggester](https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java) line 86 -\> CompletionScorer (Lucene) -\> NRTSuggester (Lucene).

And I guess the [example plugins](https://github.com/elastic/elasticsearch/tree/master/plugins/examples) contain enough sample code to start writing our own plugin.

Confirmation or other feedback is still welcome though.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 20, 2020, 8:54am UTC](https://discuss.elastic.co/t/plugin-that-can-intersect-an-automaton-with-the-completion-suggester-fsts/215908/3 "2020-02-20T08:54:34Z")

</div>

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