-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not all skos:prefLabels are indexed in FlexSearch #127
Comments
What is the wanted behaviour here? Do we also want to show results if search term was in another language? There maybe two options:
I think the first approach might be a bit confusing for users, but I'm open for discussion and feedback. |
The problem was that through multiple calls of `index.add(concept.id, i18n(language)(concept.prefLabel))` the content for the respective id got overwritten. This way only the last added label was present in the flexSearch index. To overcome this I added two functions in a new file `searchIndex.js`. `buildIndexAndScheme` creates the index scheme and the index dependent on how many languages are present. In `addToIndex` labels are concatenated to their language. With the array labelsToAdd, we have the possibility to later add on more labels per language, e.g. `skos:example` or `skos:altLabel`. We then save it just like the `.index` file, to later load it in the `App.js`template. With the adjustemnt in line 79 it is possible to choose whether to search across all languages or just the current chosen one from pageContext. Might resolve: #127, #128
We should also consider #128 ("Add strings from skos:altLabel & skos:example to FlexSearch index") in this discussion as implementing it might also lead to showing a concept label as result that does not match the search term. When broadening the context like this, I also see two options:
I think, here, the first approach makes more sense, i.e. to even show a concept when the search term matches its This would mean, for this issue, to chose your second approach from #127 (comment) which you already favoured. |
I think the vocab has to be rebuild to become effective? |
I rebuilt HCRT and Hochschulfächersystematik. Closing. |
Taking a deeper look at the FlexSearch index of some vocabularies, I noticed that not all
skos:prefLabels
are indexed. In HCRT, I found that "Abbildung" from https://w3id.org/kim/hcrt/image isn't indexed:The text was updated successfully, but these errors were encountered: