skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
34 stars 25 forks source link

Add strings from skos:altLabel & skos:example to FlexSearch index #128

Closed acka47 closed 1 year ago

acka47 commented 3 years ago

Requested by V.P. via email on 2021-02-21:

Die Suchfunktion ist ein tolles Feature der Visualisierung, die Suche sucht aber nur in den Klassenbezeichnungen und nicht in den Scope Notes und Examples. Ist dies mit Absicht so gewählt oder einfach schwieriger zu implementieren? Die Frage kam deshalb auf, weil bei unserer Klassifikation das Szenario durchaus gesehen wird, dass die Nutzenden ein Wort aus den Examples eingeben, um zu suchen, in welcher Klasse dies ist.

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 via altLabel or example definitely makes sense to me.

ghertko commented 3 years ago

... The use case to find concepts via altLabel or example definitely makes sense to me.

Oh, yes, it would be good to have this feature. Then the content of altLabel should also be visible on the concept's page.

acka47 commented 3 years ago

Then the content of altLabel should also be visible on the concept's page.

Thanks for the request. I opened an issue at #142 .

TobiasNx commented 2 years ago

Also notation is not indexed. See #161

acka47 commented 2 years ago

With using the "full" tokenizer with https://github.com/skohub-io/skohub-vocabs/pull/180 adding more fields could blow up index size for bigger vocabs with lots of alt labels and maybe long scopeNote texts. We will have to take this into account when addressing this.

sroertgen commented 2 years ago

This could also be configured with the config file #185

sroertgen commented 1 year ago

267 also suggested to search for definitions

To summarize, these fields are wanted to be searched additional to skos:prefLabel:

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:

acka47 commented 1 year ago

maybe we are now reaching the point, where we need support for a dedicated search engine

Yes. I could imagine the following approach:

sroertgen commented 1 year ago

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

cc @acka47 @carlschuurbiers

acka47 commented 1 year ago

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:

sroertgen commented 1 year ago

image

I think I'm pretty close. I just asked myself why just:

shouldn't hiddenLabel, scopeNote and note be searchable as well? @acka47

sroertgen commented 1 year ago

tagging also @carlschuurbiers if he has any opinions on that

carlschuurbiers commented 1 year ago

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.

carlschuurbiers commented 1 year ago

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...