Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

How to get suggest from few fields? #29

Open
lzerma opened this issue Apr 28, 2014 · 5 comments
Open

How to get suggest from few fields? #29

lzerma opened this issue Apr 28, 2014 · 5 comments

Comments

@lzerma
Copy link

lzerma commented Apr 28, 2014

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.

@spinscale
Copy link
Owner

what about executing several suggest requests?

@lzerma
Copy link
Author

lzerma commented Apr 29, 2014

I don't did try the second example. This works?

@spinscale
Copy link
Owner

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!

@lzerma
Copy link
Author

lzerma commented Aug 13, 2014

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}}

@spinscale
Copy link
Owner

@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/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants