elasticsearch-suggest-plugin
elasticsearch-suggest-plugin copied to clipboard
How to get suggest from few fields?
Hi, I need get all suggestions from my document, but I don't know how set multiple fields.
Ex 1 - This working fine, but is not suggest all document properties:
curl -XPOST "http://localhost:9200/index/type/__suggest" -d'
{
"field": "category_name",
"term": "c",
"size": "10",
"type": "fuzzy",
"analyzer" : "standard"
}'
I Need something like this:
curl -XPOST "http://localhost:9200/index/type/__suggest" -d'
{
"fields": {
"category_name": "value",
"other properties": "another value",
},
...
}'
Thank you.
what about executing several suggest requests?
I don't did try the second example. This works?
I was talking about two separate requests. If this is not what you want please explain it differently, its not very clear then to me. Thanks!
Hi,
Sorry for the last comments, I was very confused.
Ok, How I can, in one call to curl -XPOST "http://localhost:9200/index/type/__suggest" -d'
get the full document instead few suggests terms. So in one call to suggest plugin I can get the documents suggest.
Request:
curl -X POST localhost:9200/cars/car/__suggest -d '{ "field" : "name", "type": "full", "term" : "b", "analyzer" : "standard" }'
Response:
{"suggestions":["FULL DOCUMENT HERE","ANOTHER FULL DOCUMENT HERE"],"_shards":{"total":5,"successful":5,"failed":0}}
@lzerma that is not possible with this plugin. You could use the official completion suggester and payloads though in order to implement this... See http://www.elasticsearch.org/blog/you-complete-me/