I'm specifying a fuzzy_prefix_length in the query string, but a search for "tes" is not pulling up posts that are titled "test" ... any ideas what I'm doing wrong?
this is my query string setup
"query" : {
"query_string" : {
"query" : the-query-string-goes-here,
"default_operator" : "AND",
"fuzzy_prefix_length" : 3,
}
}
Fuzzy queryedit. Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance. An edit distance is the number of one-character changes needed to turn one term into another.
You can use the search API to search and aggregate data stored in Elasticsearch data streams or indices. The API's query request body parameter accepts queries written in Query DSL. The following request searches my-index-000001 using a match query. This query matches documents with a user.id value of kimchy .
In Elasticsearch, query string queries are their own breed of query - loads of functionality for full text search rolled into one sweet little package. In this article, we'll take a closer look at why query string queries are special and how you can make use of them.
A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML, choosing the appearance of a page, or jumping to positions in multimedia content.
You are, probably, missing "fuzzy" operator at the end of the query. Try this:
"query" : {
"query_string" : {
"query" : "tes~",
"default_operator" : "AND",
"fuzzy_prefix_length" : 3,
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With