I want multiple type suggest for single request,
eq I have data about some article and profile user data. So when we type I
need to suggest profile user as well as user data in one request.
I tried
curl -X PUT localhost:9200/suggestion -d '
{
"mappings" : {
"keyword" : {
"properties" : {
"name_suggest" : { "type" : "completion"}
}
},
"profiles" : {
"properties" : {
"name_suggest" : { "type" : "completion"},
"payload" : true
}
}
}
}'
my request is
curl -X GET localhost:9200/suggestion/_suggest?pretty -d '
{
"keyword" : {
"text" : "a",
"completion" : {
"field" : "name_suggest"
}
},
"profiles" : {
"text" : "a",
"completion" : {
"field" : "name_suggest"
}
}
}'
It need to return
{
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"keyword" : [ {
"text" : "a",
"offset" : 0,
"length" : 1,
"options" : [ {
"text" : "aba",
"score" : 1.0
}, {
"text" : "abaca",
"score" : 1.0
}, {
"text" : "abandoned land",
"score" : 1.0
}, {
"text" : "abelmoschus esculentus",
"score" : 1.0
}, {
"text" : "abies balsamea",
"score" : 1.0
} ]
} ],
"profiles" : [ {
{
"text" : "abhi dath",
"score" : 1.0
}, {
"text" : "anney lotra",
"score" : 1.0
} ]
} ]
}
but I get
{
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"keyword" : [ {
"text" : "a",
"offset" : 0,
"length" : 1,
"options" : [ {
"text" : "aba",
"score" : 1.0
}, {
"text" : "abaca",
"score" : 1.0
}, {
"text" : "abandoned land",
"score" : 1.0
}, {
"text" : "abelmoschus esculentus",
"score" : 1.0
}, {
"text" : "abies balsamea",
"score" : 1.0
} ]
} ],
"profiles" : [ {
"text" : "a",
"offset" : 0,
"length" : 1,
"options" : [ {
"text" : "aba",
"score" : 1.0
}, {
"text" : "abaca",
"score" : 1.0
}, {
"text" : "abandoned land",
"score" : 1.0
}, {
"text" : "abelmoschus esculentus",
"score" : 1.0
}, {
"text" : "abies balsamea",
"score" : 1.0
} ]
} ]
}
what is wrong ?, Is there any other approach
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0c7bb180-cbd0-4807-a172-acb6b5818b59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.