How to suggest (autocomplete) next word in elastic search?

后端 未结 2 1874
别那么骄傲
别那么骄傲 2020-12-10 12:14

Lets say I have following strings indexed:

\"My awesome pizza\"
\"My awesome beer\"
\"Heineken is awesome beer\"
\"I love pizza pepperoni\"
\"Where is my bee         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 12:29

    Just in case anyone bumps in here, the edge-n-gram approach (as noted by @Siddardha Budige) is now superseded by completion suggesters.

    They are purposely built with auto-completion in mind, so they are fast end efficient. A very informative post By the ES team can be found here.

    Two caveats:

    1. They are implemented by an in-memory Data-Structure (called a Finite State Transducer) and are therefore not suitable for large datasets that can't fit in memory.

    2. The ranking of the results is not based on similarity (a result either matches or not) so you have to be careful with blending fuzzy and non-fuzzy matches.

    EDIT: We shared our own experience with using Completion Suggesters here.

    It includes some practical examples on fuzzyness and info for non-English inputs.

提交回复
热议问题