gizmogaurav
gizmogaurav

Reputation: 1

Elastic search GET method not working

I have created index of name gizmoindex with type as Employee which contain different documents , each one has automatic generated ID. but when I am executing this query. For Example : -

localhost:9200/gizmoindex/Employee/_search
    GET
{
    "query": {
        "filtered": {
            "filter": {
                "term": {
                    "firstname": "gaurav"
                }
            }
        }
    }
}

it is not giving any output. But If I created a user defined index like : -

"localhost:9200/gizmoindex/Employee/1" 

using PUT, the above mentioned query for retreiving the result is working fine.

Upvotes: 0

Views: 201

Answers (1)

Neo-coder
Neo-coder

Reputation: 7840

Check this URI search and modified your search query as below

curl -H GET localhost:9200/gizmoindex/Employee/_search?pretty=1 -d ' 
{
    "query": {
        "filtered": {
            "filter": {
                "term": {
                    "firstname": "gaurav"
                }
            }
        }
    }
}

Upvotes: 1

Related Questions