-
Notifications
You must be signed in to change notification settings - Fork 94
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
Unique flag not working? #429
Comments
The problem is that there are no hints in the REST query about which language to prefer. All three languages end up having the same priority. If you add a https://skosmos.biblionaut.net/rest/v1/search?query=nanomedi*&labellang=nb&unique=true Note that the https://skosmos.biblionaut.net/rest/v1/search?query=nanomedic*&labellang=nb&unique=true Not sure if this is a bug or a feature, at least it should be documented somewhere. |
Aha, mainly a documentation issue then. The behaviour is acceptable once you understand it, but it's not straightforward intuitive :) |
It surprised me too! I think this might still be a bug, but I haven't yet investigated in detail why this happens. |
Even if the REST query doesn't specify any language, we could fall back to the default language of the vocabulary, as is done for other REST methods. |
The REST call made by the UI doesn't set the unique flag at all, so it is not directly affected by this issue. This is done deliberately, in order to not hide matches from the user. For example, if the query in your screenshot only showed a match for "Nanomedisin"@nb, the user might erroneously conclude that "Nanomedicine”@en and "Nanomedisin"@nn are not in the vocabulary. We've had situations like this before and have decided to opt for showing all the matches, even though there are duplicates. |
This actually doesn't affect the current development version anymore, probably as a side effect of the refactoring done in #393. finto.fi is running v1.4-maintenance and shows the problem: dev.finto.fi is running current master and doesn't have the problem: Unfortunately the refactoring in #393 is extensive, it cannot be backported to v1.4. If this is a real problem for current 1.4 usage then we can consider making a quick fix (probably just identifying the situation where unique=true but no search language is given, and setting the label language to the default language of the vocabulary). |
Cool, I'll pull in the latest version then. |
I've verified that the language now always defaults to the vocabulary default language, so this problem should be fixed for good in 1.5. |
I would expect one result here, but get three: https://skosmos.biblionaut.net/rest/v1/search?query=nanomedi*&unique=true
(Btw. my Skosmos installation is at @2947b94c434)
The text was updated successfully, but these errors were encountered: