Hi Vineeth, Thanks for the response.
I actually want the output to be flexible ( returning matched tokens) instead of a hard coded vaue. eg. For "input": ["AAA","BBB","CCCC","DDD","EEE","US","California"," Framework","IIII","JJJJ","KKK","LLL","999","888"] if "Cali" was searched then output should be "California" if "Frame" was searched then output should be "Framework" On Mon, Apr 13, 2015 at 10:33 PM, vineeth mohan <[email protected]> wrote: > Hello AP , > > Yes that is how it works. > If the input text ( cali ) is the affix of any of the input then the > output would be returned. > > { > "id" : "ID1", > "name" : "AAA BBB CCCC DDD EEE FFFF GGG HHHHH IIII JJJJ KKK LLL > 999 888", > "suggest" : { > "input": > ["AAA","BBB","CCCC","DDD","EEE","US","California","Framework","IIII","JJJJ","KKK","LLL","999","888"], > "output": *"California City"* > "payload" : { > "id" : "ID1", > "name" : text > } > } > > In this example , if the input string is cali or fra or ee or US , it will > all match to "Califronia City" and this output text and payload would be > returned. > > Thanks > Vineeth Mohan, > Elasticsearch consultant, > qbox.io ( Elasticsearch service provider <http://qbox.io/>) > > > On Mon, Apr 13, 2015 at 11:53 PM, Ap <[email protected]> wrote: > >> How do you get the exact matched token from the completion suggester ? >> >> eg. >> { >> "id" : "ID1", >> "name" : "AAA BBB CCCC DDD EEE FFFF GGG HHHHH IIII JJJJ KKK LLL >> 999 888", >> "suggest" : { >> "input": >> ["AAA","BBB","CCCC","DDD","EEE","US","California","Framework","IIII","JJJJ","KKK","LLL","999","888"], >> "output": *<This should return the matched token only>* >> "payload" : { >> "id" : "ID1", >> "name" : text >> } >> } >> >> So if a user types cali, the output that needs to be returned to the user >> is the matched token "California" instead of the complete string or id. >> >> Thanks >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elasticsearch/7b04ed89-814d-48e4-8666-c4f24f45186d%40googlegroups.com >> <https://groups.google.com/d/msgid/elasticsearch/7b04ed89-814d-48e4-8666-c4f24f45186d%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 a topic in the > Google Groups "elasticsearch" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/elasticsearch/x0UIaDVLX0Q/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D2fvicp6MPfTLV-HkL-NtHE7d7cQBJXoz9MK%2Btz6uJgg%40mail.gmail.com > <https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D2fvicp6MPfTLV-HkL-NtHE7d7cQBJXoz9MK%2Btz6uJgg%40mail.gmail.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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAFJXNN6Dp90CvNpuw5twFG%3DFzPUKxWEHYYjLdkMCXMr8qZXixQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
