| Summary: | Searching with hyphen doesn't work with Elasticsearch | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Joonas Kylmälä <joonas.kylmala> |
| Component: | Searching - Elasticsearch | Assignee: | Peter Vashchuk <stalkernoid> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | domm, esther.melander, lisette, lucy.vaux-harvey, nugged, stalkernoid |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
Description
Joonas Kylmälä
2021-05-10 14:25:21 UTC
In Elastic Search a hyphen operates as an 'or'. Trying to search for a term like steam-boiler will return results where the term steam or boiler exists. In order to get correct search results add quotation marks "steam-boiler" to force Elastic Search to see it as a single term. Another example is to search for U-2 boats using U2 rather than U-2. U2 is a single term but it is not returning the expected results because U2 doesn't match "U-2" or U or a 2. One option is to add U2 to a 246 varying title tag so that it appears in search results. I think in this case Elastic Search is working the way it was designed. The question is should Koha make an exception to using the hyphen as a boolean operator? I can see that this could be quite an issue for German as well as we do have a lot of words that are hyphenated. |