Elasticsearch Query DSL Returning No Results Despite Matching Documents in Index
I'm optimizing some code but I've looked through the documentation and I'm still confused about I'm working with Elasticsearch 8.2 and have created an index with the following mapping: ```json { "mappings": { "properties": { "title": {"type": "text"}, "published_date": {"type": "date"}, "tags": {"type": "keyword"} } } } ``` I've indexed a few documents that look like this: ```json { "title": "Introduction to Elasticsearch", "published_date": "2023-09-15", "tags": ["elasticsearch", "search"] } { "title": "Advanced Elasticsearch Techniques", "published_date": "2023-10-01", "tags": ["elasticsearch", "performance"] } ``` However, when I try to run a search query looking for documents with the keyword 'elasticsearch', it returns no results: ```json { "query": { "match": { "title": "elasticsearch" } } } ``` I confirmed that documents exist in the index by using a simple `GET /<index_name>/_search` request which returns the documents as expected. I've also verified that the index is not empty and the documents are indexed correctly. I tried using different analyzers for the title field, but it didn't help. For testing, I also tried a `match_all` query, which works fine. Still, the `match` query does not return the expected results, and I am puzzled about why this is happening. Could this be a question with how the text is being analyzed or something else? I'd appreciate any insights or recommendations on what to check next. My development environment is macOS. Has anyone else encountered this? I'm coming from a different tech stack and learning Json. Any pointers in the right direction? Any advice would be much appreciated.