Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
helper-build-query
{"wildcard":{"displayName":"*"}}
✓ an empty query
{"filtered":{"query":{"bool":{"must":[{"match":{"displayName":"ama"}}]}}}}
✓ a query text query
{"filtered":{"query":{"bool":{"must":[{"match":{"displayName":"ama"}},{"match":{"displayName":"bank"}}]}}}}
✓ a query text with multiple strings query
{"filtered":{"query":{"bool":{"must":[{"match":{"displayName":"ama"}},{"match":{"displayName":"bank"}}]}}}}
✓ a query text with multiple strings query and excessive white space
{"filtered":{"query":{"bool":{"must":[{"match":{"displayName":"côte"}},{"match":{"displayName":"d’ivoire"}}]}}}}
✓ a query text with multiple strings query and special chars
{"filtered":{"filter":{"bool":{"must":[{"terms":{"_kind":["_person"]}},{"terms":{"baseCountry":["angola","south africa"]}},{"terms":{"sector":["agriculture"]}}]}}}}
✓ a query with multiple facets
{"filtered":{"query":{"bool":{"must":[{"match":{"displayName":"zen"}},{"match":{"displayName":"bank"}}]}},"filter":{"bool":{"must":[{"terms":{"_kind":["_person"]}},{"terms":{"baseCountry":["angola","south africa"]}},{"terms":{"sector":["agriculture"]}}]}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.