ElasticSearch GET vs POST Search Results for Querystring -
why getting different results these 2 types of queries. 1st query return 17 results, 2nd 1 returns 300+ records.
also tried setting query value second string "a&b", seeing same result differences.
get
get dev/data,legacydata/_search?q="a%26b"
post
post dev/data,legacydata/_search { "from": 0, "size": 1000, "query": { "query_string": { "query": "a&b" } } }
when using double quotes in q query,
it represents exact filter
get dev/data,legacydata/_search?q="a%26b"
its equivalent post query is
post dev/data,legacydata/_search { "from": 0, "size": 1000, "query": { "query_string": { "query": "\"a&b\"" } } }
so try following
get dev/data,legacydata/_search?q=a%26b post dev/data,legacydata/_search { "from": 0, "size": 1000, "query": { "query_string": { "query": "a&b" } } }
you same results
Comments
Post a Comment