All the documents in my index have a field called 'name' which is used for querying by typed terms. I need the search to recommend the most relevant 'second word' for the customer to type when they enter the first word. I tried finding the products using the typed word and aggregating them by name to remove duplicates. However, the problem is that it returns the entire 'name' field instead of just the next word. The same scenario occurs when I try the Completion Suggestion, which makes sense because it completes the whole text based on the field I specify. I understand that it would be easier with some data engineering on my products' names and attributes to create fields that resemble suggestion fields. But is there any scenario or possibility within Elasticsearch that I am missing?
It is important to mention that I am using Elasticsearch 6.x.