Simple_query_string check if field exists

Hi,

How would I use simple_query_string to check if a field exists? For example, say if I had the following documents

PUT test_index/_doc/1
{
"user" : "test",
"message" : "a"
}

PUT test_index/_doc/2
{
"user" : "test",
"message" : "b"
}

PUT test_index/_doc/3
{
"user" : "test",
"message" : "c"
}

PUT test_index/_doc/4
{
"user" : "test"
}

How do I query for documents where (message = "a" OR "b") OR (message field doesn't exist). The query should return documents 1, 2 and 4. I realise this is trivial with

"must_not": {
"exists": {
"field": "message"
}
}

but I need to perform this with simple_query_string.

the query string query supports _exists_: as a syntax, but the simple query string does not IIRC.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.