0

How I can get this simple query in Elasticsearch?

SELECT * FROM [mytype] WHERE name = alex AND health = good

I'm really having troubles with its syntax, multi-match queries don't work in my case, what type of query should I use?

0

1 Answer 1

1

You can use multiple must clauses in a bool query to combine queries. For example,

{
    "query": {
        "bool": {
            "must": [
                {
                    "term": {"name" : "alex"}
                },
                {
                    "term": {"health" : "good"}
                }
            ]
        }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.