You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Result for semantic search with query "[[HasLabel::BMD_StandardCU_V3]]" delivers random results #111
semantic search performed on query "[[HasLabel::BMD_StandardCU_V3]]" either finds correct Item (Item:OSWb1d840f8f9df4e74b9a0e2f7d2977269) or results in "Query '[[HasLabel::BMD_StandardCU_V3]]|limit=1000' returned no results"
No specific order of results but seems rather random.
Maybe linked to default limit of 1000 (results? entries considered in OSLab?)?
No page is consistently '', and the flips are perfectly correlated across all 8 pages (calls 0,2,3,4,7 agree; calls 1,5,6 agree). That bimodal pattern points at inconsistent state between backends or an SMW query-result cache, not at real deletions. Consecutive identical calls to semantic_search returned 998 or 994 titles.
This needs fixing on the OSL instance side. The library can only make it visible.
2. Silent truncation at the default limit
The guess in the original report about the 1000 limit was right. SearchParam.limit defaults to 1000 and there is no pagination, so a larger match set is silently reduced to an arbitrary subset:
[[Category:Item]] via |offset= pagination -> 2637 unique pages
[[Category:Item]] via semantic_search -> 1000 (no warning)
Not a cause: sort order
I checked whether adding |sort=|order=asc stabilises the truncated subset. It does not - the result hash still varies across identical calls, identically to the unsorted control. Appending a sort clause would also silently override a caller's own sort, since SMW honours the last one. So that is not a viable workaround.
What changed
#150 adds a warning when a query hits its limit and a warning naming how many results were dropped as non-existing, so neither failure mode is silent any more. It deliberately does not change the filter semantics or the default limit.
Reopening is probably warranted for cause 1, since it is still live.
Activity
simontaurus commentedon Nov 3, 2025
Reference API request (now) returns stable result:
https://healthbatt.projects01.open-semantic-lab.org/w/api.php?action=ask&query=[[HasLabel::BMD_StandardCU_V3]]|limit=1000&format=jsonProbably a data rebuild was running, leading to inconsistencies.
LukasGold commentedon Aug 31, 2026
The "random results" reproduce on
healthbatt.projects01.open-semantic-lab.organd are not a data rebuild. Two causes, both measured.1.
existsflickers server-sidesemantic_searchonly keeps results whoseexistsfield equals"1"(https://github.com/OpenSemanticLab/osw-python/blob/main/src/osw/wiki_tools.py#L263). The field only ever takes'1'or'', but it is not stable. Eight identical[[Category:Item]]|limit=1000calls:No page is consistently
'', and the flips are perfectly correlated across all 8 pages (calls 0,2,3,4,7 agree; calls 1,5,6 agree). That bimodal pattern points at inconsistent state between backends or an SMW query-result cache, not at real deletions. Consecutive identical calls tosemantic_searchreturned 998 or 994 titles.This needs fixing on the OSL instance side. The library can only make it visible.
2. Silent truncation at the default limit
The guess in the original report about the 1000 limit was right.
SearchParam.limitdefaults to 1000 and there is no pagination, so a larger match set is silently reduced to an arbitrary subset:Not a cause: sort order
I checked whether adding
|sort=|order=ascstabilises the truncated subset. It does not - the result hash still varies across identical calls, identically to the unsorted control. Appending a sort clause would also silently override a caller's own sort, since SMW honours the last one. So that is not a viable workaround.What changed
#150 adds a warning when a query hits its limit and a warning naming how many results were dropped as non-existing, so neither failure mode is silent any more. It deliberately does not change the filter semantics or the default limit.
Reopening is probably warranted for cause 1, since it is still live.