问题
This query -
curl -XGET http://localhost:9200/haystack/modelresult/_search?q=post_text:#test
fails to execute with an error
SearchPhaseExecutionException[Failed to execute phase
with status 400
回答1:
Try this:
curl -XPOST "http://localhost:9200/haystack/modelresult/_search" -d'
{
"query": {
"match": {
"post_text": "#test"
}
}
}'
or this:
curl -XPOST "http://localhost:9200/haystack/modelresult/_search" -d'
{
"query": {
"term": {
"post_text": "#test"
}
}
}'
来源:https://stackoverflow.com/questions/33901928/unable-to-search-in-elasticsearch