Hi,

really appreciate that you are looking into this. I got it working with 
elasticsearch-1.0.0.RC2 
release. I don't know what was wrong with 0.90. Now the deletes and updates 
are ok anyway I have a question. If there are two documents with "exactly" 
the same input - in my case i put two documents with input 'jorge' , is 
there a way how to get both of the documents returned for suggest query ? I 
only get one back which probably has the highest priority. 

Thanks,

Jorge 

Dne pátek, 7. února 2014 16:24:30 UTC-6 Binh Ly napsal(a):
>
> Jorge,
>
> I ran your sequence and I got these results which look correct:
>
> {
>   "_shards" : {
>     "total" : 5,
>     "successful" : 5,
>     "failed" : 0
>   },
>   "user-suggest" : [ {
>     "text" : "j",
>     "offset" : 0,
>     "length" : 1,
>     "options" : [ {
>       "text" : "jorge",
>       "score" : 1.0, "payload" : {"userid":2,"grouporuser":"user"}
>     }, {
>       "text" : "jorge sanchez",
>       "score" : 1.0, "payload" : {"userid":2,"grouporuser":"user"}
>     } ]
>   } ]
> }
>
> Then I did this:
>
> DELETE http://localhost:9200/gruppu/user/2?refresh=true
>
> And query again, and I got this:
>
> {
>   "_shards" : {
>     "total" : 5,
>     "successful" : 5,
>     "failed" : 0
>   },
>   "user-suggest" : [ {
>     "text" : "j",
>     "offset" : 0,
>     "length" : 1,
>     "options" : [ {
>       "text" : "jorge",
>       "score" : 1.0, "payload" : {"userid":100000001,"grouporuser":"group"}
>     } ]
>   } ]
> }
>
> And then
>
> DELETE http://localhost:9200/gruppu/user/100000001?refresh=true
>
> And query again, and I got this:
>
> {
>   "_shards" : {
>     "total" : 5,
>     "successful" : 5,
>     "failed" : 0
>   },
>   "user-suggest" : [ {
>     "text" : "j",
>     "offset" : 0,
>     "length" : 1,
>     "options" : [ ]
>   } ]
> }
>
> Keep in mind that when you suggest on "j", this entry will produce 2 
> suggestions because it matches both "jorge" and "jorge sanchez":
>
> post /gruppu/user/2?refresh=true
> {
>     "name" : "jorge",
>     "suggest" : {
>         "input": [ "jorge", "sanchez", "jorge sanchez" ],
>         "payload" : { "userid" : 2, "grouporuser": "user" }
>     }
> }
>
> If you don't want that behavior, set the output property to a single 
> string that will uniquely identify a single suggestion (instead of 2 
> suggestions for the above entry). So for example:
>
> {
>     "name" : "jorge",
>     "suggest" : {
>         "input": [ "jorge", "sanchez", "jorge sanchez" ],
>         "payload" : { "userid" : 2, "grouporuser": "user" },
>         "output": "jorge sanchez"
>     }
> }
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1c0ef13b-6d6a-460e-aa97-934df7bee0ec%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to