Conversation
olovy
approved these changes
Feb 23, 2026
Contributor
olovy
left a comment
There was a problem hiding this comment.
LGTM!
We need to make sure that spell checking fails silently when using the new SPELL_CHECK_FIELD with the old index (during first reindex).
Member
Author
|
Turns out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently we use
_sortKeyByLang.svfor "did you mean....?" spelling suggestions. This is less than ideal. Here's an instance, "Jag tar inte farväl" by Han Kang: https://libris.kb.se/2m16tzmd08b73b4gIts
_sortKeyByLang.svis "Jag tar inte farväl, Svenska". No author there. So in Libris sökham tar inte farvälresults in no suggestions; "kangg tar inte farväl" results in the suggestion "könig tar inte farväl"; and so on. More generally<part of author name> <part of title>doesn't work at all because there's no connection between contributor and title in_sortKeyByLang.However,
_chipStrcontains both of those things. In this example "Jag tar inte farväl Jag tar inte farväl Svenska Swedish Han Kang 1970-". So it should work better.I've also experimented with custom lenses and custom ES fields only for spelling, but this might be good enough, possibly after tinkering with the parameters of the ES spell suggestion query (https://www.elastic.co/guide/en/elasticsearch/reference/8.11/search-suggesters.html#phrase-suggester).
Anyway, need to test it with all the data and not just the tiny dev data to see if this is enough. It should at the very least be better than now.
https://kbse.atlassian.net/browse/LWS-424