In this short article, I will just mention a few things about the query string approach, before I will move on to showing you how to search with the query DSL.
Firstly, I want to mention that any special characters that you include in query string searches must be escaped with a backslash. Special characters are any that have special meaning to Elasticsearch, such as parenthesis, plus, minus and equals signs, question marks, etc.
There are more features available to you if you are using the query string approach for your searches. We will get back to some of it in the following lectures, but if you have a use case that cannot be solved with what I walked through in this lecture, then I encourage you to check out the documentation on query string searches.
You should now have an overall understanding on how to perform searches with query strings in Elasticsearch. In the next article, we will take a look at searching with the query DSL, which is the other way of searching in Elasticsearch. Until then, happy searching!
Learn Elasticsearch today!
Take an online course and become an Elasticsearch champion!
Here is what you will learn:
- The architecture of Elasticsearch
- Mappings and analyzers
- Many kinds of search queries (simple and advanced alike)
- Aggregations, stemming, auto-completion, pagination, filters, fuzzy searches, etc.
- ... and much more!