Is there a "real" autocomplete anymore in elastic?


#1

Hi,
For the life of me, I can't understand why elastic changed the useful and common use-case of finding autocompletion words and abandoned it for entire document results? Who and why was this decision made? It creates many more problems than it attempts to solve.

Why would I want to auto-complete a document? That makes no sense at all. Before, I can autocomplete words and phrases and pull the document if I needed it.

What is the fix for this bug?

thank you.


(David Pilato) #2

It depends on the use case but I'd not qualify it as a bug but as an enriched feature. :smiley:

May be explain with a full example what exactly your problem is and we will try to help you solving it.


#3

Ok. Thanks.

A user starts typing in a search box and wants to see qualifying words and phrases that begin with their text. I did find a way to do this, but I have to keep a separate document type and mapping to support it. Apparently, I can't complete words in lists of a document and return only those words. I don't want to return all _source and then have to figure it out separately.


(David Pilato) #4

I understand the problem. I was asking for a script to reproduce it.

Like it is described in:


#5

Well, I guess this is a feature decision of elastic to not be able to return autocomplete suggestions of document fields and return only those matching fields. instead it returns entire document. To get anywhere close to basic autocomplete, I have to set up completely separate indexes with only the fields I want to autocomplete on as their own documents and then hope these separate indexes stay in sync with my master document index.

I really don't see why elastic can't make this easier.

Document A:

{
"name": .....
"address": ....
"title": ....
}

I want to accept some query string and then ask for any matching fields of documents where they complete the query string. I don't necessarily know in advance which fields those might be and I don't want to construct a query enumerating all the fields. Which could easily change over time in the index.

As a result, I want list of matching fields and doc id's and the value of the matched field. Pretty simple. And a very common use case elastic just does not support easily.


(David Pilato) #6

Sorry. I can't help without a script.


#7

There is no script. The title of the post is a question, which requires a yes or no answer. If you understand the question (see the title of the post) and the problem behind it, then I think you have everything needed to offer some suggestion. There is nothing to reproduce because the post is inquiring about a lack of capability, not a broken existing capability.


(David Pilato) #8

I think there is a solution. It's explained somewhere here: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters-completion.html#querying


(system) #9

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