An otherwise intelligent sysadmin may wonder why Elasticsearch fuzzy searches with "~" don't work and go looking for answers. The current phrasing of the QueryFuzzy syspref is unclear and suggests that the syspref only affects users of Zebra. This is not the case, as the syspref must be set to "Try" on Elasticsearch systems as well in order to enable fuzzy searches. Current phrasing: [Try/Don't Try] to match similarly spelled words in a search. (For example, a search for flang would also match flange and fang; Currently only affects Zebra searches. Any Elasticsearch term can be made fuzzy by adding a ~ directly after the term.) Suggested wording: [Try/Don't Try] to match similarly spelled words in a search. (For example, a search for flang would also match flange and fang.) If using Zebra, searches become fuzzy by default. If using Elasticsearch, a term must be made fuzzy by adding a ~ directly after the term.
Noting here that in addition to clarifying the system preference helper text, the manual has an explicit note saying it only works with Zebra, which we know is no longer true :https://koha-community.org/manual//25.05/en/html/searchingpreferences.html#queryfuzzy
Oh it works with Elasticsearch ?
Is this bug about updating the Manual or changing the sys pref description in the staff interface? It sounds like both are needed, but if you want the sys pref description changed please use the Component = Staff interface.
(In reply to Aude Charillon from comment #3) > Is this bug about updating the Manual or changing the sys pref description > in the staff interface? It sounds like both are needed, but if you want the > sys pref description changed please use the Component = Staff interface. Ok done! Thanks for the clarification. Both are needed but this bug was intended for the syspref description.
(In reply to Mathieu Saby from comment #2) > Oh it works with Elasticsearch ? It does!
I was going to submit a patch to update the system preference description, as I can confirm that the example and system preference works with Elasticsearch. However, I can't get the example and system preference to work with Zebra! Using Zebra (using KTD): 1. Edit three records, so that they have these terms in the title: 1.1 Record 1: flang 1.2 Record 2: flange 1.3 Record 3: fang 2. Search for flang with the different options for QueryFuzzy: 2.1 Don't try: should return records 1 and 2 - it does! 2.2 Try: should return all three records, however it doesn't - it only returns records 1 and 2 (even after a re-index) Does anyone have a better example of a fuzzy search that works with both Zebra and Elasticsearch, or does this indicate that something isn't working as it should for Zebra? If it is the later, then it is a different problem to solve and way beyond my level of expertise to fix! Draft commit message with test plan and updated system preference description ============================================================================= Bug 41051: Update QueryFuzzy system preference description This updates the description for the QueryFuzzy system preference to make it clear that it works for both Zebra and Elasticsearch engines. The current description implies that it only works with Zebra. Test plan: 1. Start up KTD normally, using Zebra as the search engine (the default): ktd up 2. Edit three records, so that they have these terms in the title: 2.1 Record 1: flang 2.2 Record 2: flange 2.3 Record 3: fang 3. Search for flang with the different options for QueryFuzzy: 3.1 Don't try: should return records 1 and 2 3.2 Try: should return all three records 4. Shut down KTD and start up with Elasticsearch: ktd --search-engine es7 up 5. Repeat step 2. 6. Search for flang with the different options for QueryFuzzy: 3.1 Don't try: should only return records 1 and 2 3.2 Try: should only return records 1 and 2 7. Search for flang~ with the different options for QueryFuzzy: 3.1 Don't try: should only return record 1 3.2 Try: should return all three records (plus other records as well) 8. Check the updated wording for the QueryFuzzy system preference and confirm that it is clear and makes sense: 8.1 Current description: [Don't try|Try] to match similarly spelled words in a search. (For example, a search for flang would also match flange and fang; Currently only affects Zebra searches. Any Elasticsearch term can be made fuzzy by adding a ~ directly after the term.) 8.2 Updated description: [Don't try|Try] to match similarly spelled words in a search (for example, a search for flang would also match flange and fang). Zebra searches are fuzzy by default. If using Elasticsearch, add ~ after the search term, for example: flang~.