elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.06k stars 24.52k forks source link

Completions suggester needs some love! #73326

Open nik9000 opened 3 years ago

nik9000 commented 3 years ago

A few of us were debugging some run away memory usage and ran into a fairly large on heap FST owned by the completion suggester. I'd like to talk the future of our friend the completion suggester. I think we should talk about doing some combination of:

elasticmachine commented 3 years ago

Pinging @elastic/es-search (Team:Search)

nik9000 commented 3 years ago

I believe the completion suggester was designed for cases where you have a large hand full of fairly short strings to suggest - thousands or tens of thousands of strings which are well less than a kilobyte - that sort of thing. When you don't do that it uses a bunch of memory. That's how it was designed at the time - intentionally keeping everything in heap memory for the fastest possible access. That can cause folks some trouble. The search as you type field does everything on disk instead. That can be quite quick because it'll all end up cached in memory anyway, but when its not hot doesn't have to be in memory.

We can get some of this by moving the FST off heap, but its worth asking if we want two ways to do very similar things.

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-search-relevance (Team:Search Relevance)