Autocomplete returns - can you get input word that was matched?


(redrubia) #1

From autocompleter, usually you return the matched word, the output. Is
there any way to return exactly what you matched on?

For example if you look at the completion info herehttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html you'll
see the input for a doc is a list [ "Nevermind", "Nirvana" ] . But how do
we know if we complete on 'Nevermind' or 'Nirvana'? Arguably you can say if
the input is 'Ne' assume Nevermind, and similarly for 'Ni' for Nirvana, but
what about when these inputs get more complex? You want to know the exact
input completed on, so you can say to the user 'Your input matches xxx',
but its 'xxx'

My main reason for asking is I have created a company index, and well there
are mergers. For example someone may type Merrill Lynch to get back Bank of
America as their output. So when they type 'Merr' to get 'Bank of America',
it lacks consistency for the user. I'd like to improve upon this, so I can
say ''Merrill Lynch', did you mean 'Bank of America'?'

A long winded way of doing this would be to then look up the document in
the index, and determine which input was used... but this is extremely long
winded. Also secondly you could place every variant in a separate document,
so input is just a string. But this means you'd quite possibly have
multiple docs being returned with the same name, to show up multiple times
in the response (not ideal).

Any ideas on how to do this? or if the functionality is there?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0d866dcd-ba1e-4b56-b76b-9a01d891a759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Alexander Reelsen) #2

Hey,

it is possible to not specify an output, then every input becomes the
output. However, this does not allow to create a unified output, which, I
think, is the whole purpose. There is no way to find out, which of the
input actually has matched currently.

Trying to have very good outputs like, "Bank of America (before: Merryll
Lynch)" might be an idea...

--Alex

On Wed, Apr 9, 2014 at 1:44 AM, redrubia ruby.childs1@gmail.com wrote:

From autocompleter, usually you return the matched word, the output. Is
there any way to return exactly what you matched on?

For example if you look at the completion info herehttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html you'll
see the input for a doc is a list [ "Nevermind", "Nirvana" ] . But how do
we know if we complete on 'Nevermind' or 'Nirvana'? Arguably you can say if
the input is 'Ne' assume Nevermind, and similarly for 'Ni' for Nirvana,
but what about when these inputs get more complex? You want to know the
exact input completed on, so you can say to the user 'Your input matches
xxx', but its 'xxx'

My main reason for asking is I have created a company index, and well
there are mergers. For example someone may type Merrill Lynch to get back
Bank of America as their output. So when they type 'Merr' to get 'Bank of
America', it lacks consistency for the user. I'd like to improve upon this,
so I can say ''Merrill Lynch', did you mean 'Bank of America'?'

A long winded way of doing this would be to then look up the document in
the index, and determine which input was used... but this is extremely long
winded. Also secondly you could place every variant in a separate document,
so input is just a string. But this means you'd quite possibly have
multiple docs being returned with the same name, to show up multiple times
in the response (not ideal).

Any ideas on how to do this? or if the functionality is there?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/0d866dcd-ba1e-4b56-b76b-9a01d891a759%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/0d866dcd-ba1e-4b56-b76b-9a01d891a759%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_YDiREKYxnjRaeugZhTAgGeO4yK0zC%2BXLFZ-QiYtsZjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(redrubia) #3

Hi Alex,

Thanks for your response. Yes I agree, autocomplete is to find a unified
name, but it is also extremely handy to know what the matched word was. You
can technically infer this from adding the doc id within pay load, and thus
look it up afterwards but this is long winded. One main advantage of
knowing what the match is, is for analytics, such as if you want to see
what variant was most commonly used to then make it a doc in its own right.

Would be good to see if this functionality can be build into ES to see the
exact matches and the unified output result.

Thanks

Ruby

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5c04f395-6725-4de0-8b7a-4bc1796f7342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4