While typing, the set of results is already narrowed down and could already be used to guide users to the desired search result.
This function does not correct typos, but if the user is careful, it may prevent them or allow for faster correction.
it's not surprising that extensions build on top of the project to solve use cases. Extensions for Elasticsearch can take the form of plugins, which are relatively easy to install. Here we'll look at the phonetic analysis plugin, which allows us to get phonetic representations of input tokens.
After defining an analyzer that uses the phonetic token filter, the natural language slovenia consumer email list can be converted into a phonetic representation. This depends on the chosen algorithm and the source language, but can also be recommended by Elastisearch. To test the analyzer, we compare the tokens resulting from the analysis of “Michael” and “Micheal”.
By chance, we can already see that there is an overlap in the phonetic representation between “Michael” and “Micheal”. In this case, the phonetic conversion would be enough to correct the typo in the user input. This way, we should already get some results that might be somewhat acceptable for a test user base. So far, however, we have focused on finding good data types to prepare the data we want to query. However, the query types we have explored so far are quite simple and do not exploit Elasticsearch's Query DSL.
fuzziness
Fuzziness is a fairly simple concept available in many types of queries defined in the Elasticsearch Query DSL. Applied to our previous example, it solves the problem by expanding the searched query terms to similar tokens, for example by changing or removing a character or by swapping adjacent characters.
A disadvantage of fuzzy queries, although attractive, is their relatively high computational cost, which can affect query execution time on larger data sets and increase the size of the result set3.
Compound queries
It's time to combine multiple queries into a more complex query that allows finer control over our result set and its order. A very popular query type is the Boolean query, which does exactly what its name suggests: it combines multiple queries into a Boolean construct (i.e. and, or, and not).
Since Elasticsearch is an open source project
-
- Posts: 162
- Joined: Sat Dec 21, 2024 5:59 am