How to _suggest on multiple fields in elasticsearch?

To spell check / suggest one single field, we can do as follows:

curl -XPOST localhost:9200/index/type/_suggest -d '{
"field": "MY_FIELD1.suggest",
"term": "wrongly_spelled_word",
"similarity": 0.3 }'

But how do we do the same thing on several fields like MY_FIELD1,
MY_FIELD2
etc. I tried

"fields": ["MY_FIELD1.suggest", "MY_FIELD2.suggest"]

etc, but it was not working.

--

Hi

On Mon, Nov 12, 2012 at 12:28 PM, Prakhar Goel i@prakhargoel.com wrote:

To spell check / suggest one single field, we can do as follows:

curl -XPOST localhost:9200/index/type/_suggest -d '{
"field": "MY_FIELD1.suggest",
"term": "wrongly_spelled_word",
"similarity": 0.3 }'

But how do we do the same thing on several fields like MY_FIELD1,
MY_FIELD2
etc. I tried

"fields": ["MY_FIELD1.suggest", "MY_FIELD2.suggest"]
Querying multiple fields with one query is not supported (and there is
no plan to do that - your usecase can easily be achieved, see below)

Just issue multiple requests... if you issue them async you wont have
a much bigger delay than before.
As an alternative you could setup your _all field appropriately and
query this one.

--Alexander

--