Hi,
I'm trying to find documents in which certain field exist using POST. Here is the code snippet that I'm using. For example, I would like to find all the documents in which "activity_name" field is present.
> {
> "query": {
> "filtered": {
> "query": {
> "bool": {
> "should": [
> {
> "query_string": {
> "query": "type:\"help-me\""
> }
> }
> ]
> }
> },
> "filter": {
> "bool": {
> "must": [
> {
> "exists": {
> "field": "activity_name"
> }
> }
> ]
> }
> }
> }
> },
> "size": 5
> }
The above code doesn't return any hits. Is this the right way to do it or am I missing something here?
Regards,
Bharath