-
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
Add strings from skos:altLabel & skos:example to FlexSearch index #128
Comments
Oh, yes, it would be good to have this feature. Then the content of |
Thanks for the request. I opened an issue at #142 . |
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
Also notation is not indexed. See #161 |
With using the "full" tokenizer with #180 adding more fields could blow up index size for bigger vocabs with lots of alt labels and maybe long |
This could also be configured with the config file #185 |
#267 also suggested to search for definitions To summarize, these fields are wanted to be searched additional to
This might blow up the index clients have to download. @acka47 maybe we are now reaching the point, where we need support for a dedicated search engine. Tasks:
|
Yes. I could imagine the following approach:
|
To work on this issue I decided to first fix #186. This was long due and will help us on this issue. Question I have is: How do we want to show the user that a concept matches though it is not the skos:prefLabel that matches? I'm thinking of displaying the concept in italics and then maybe providing something like a tooltip? Any other suggestions? Will post something here when I have a first prototype |
What about somehow adding the field in brackets after the preflabel? E.g. like: Search for "dialekt" in https://test.skohub.io/hbz/lobid-vocabs/heads/master/nwbib.de/subjects.de.html: Show:
|
I think I'm pretty close. I just asked myself why just:
shouldn't hiddenLabel, scopeNote and note be searchable as well? @acka47 |
tagging also @carlschuurbiers if he has any opinions on that |
sure, that would be very useful, I think if one is searching for some expression, you will probably want to look everywhere. I only hope it will not clutter the interface too much if you add a checkbox for every expression... But it is a great feature! One of the possible use cases would be: editors that need to determine which school subject(s) they should allocate to a certain learning object that are confronted with a huge list of possible school subjects (Sachgebietssystematik) can use various search expressions, and these expressions will be found in definitions/altLabels/examples/notations etc. and this will point them to a narrowed down set of possible subjects which they will then consider, choose from and allocate. |
is it possible to highlight the other places where an expression was found in the right window? So if nothing is highlighted in the left window, one can click on the entry and in the right window, where all data is displayed, the corresponding text is highlighted? adding just the altLabel in the left window is great though. But we can't add all labels there... |
Requested by V.P. via email on 2021-02-21:
It looks like that currently the FlexSearch index is only built from
skos:prefLabel
in all languages that are provided (although there seem to be some problems with this, see #127). The use case to find concepts viaaltLabel
orexample
definitely makes sense to me.The text was updated successfully, but these errors were encountered: