Skip to content

Conversation

@andersju
Copy link
Member

It can happen that the placeholder is missing, resulting in an exception. Noticed on QA with the query /find?_q=NOT+kategori%3A%28*%29&_limit=5&cursor=15&_sort=&_r=&_suggest=true:

2025-12-11T10:03:41,418 [qtp550147359-316] ERROR whelk.util.http.HttpTools - Internal server error: Range [0, -1) out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 14
	at whelk.search2.SuggestQuery.lambda$getPartialCollectionView$0(SuggestQuery.java:68) ~[rest.jar:?]
	at whelk.search2.SuggestQuery.lambda$getPartialCollectionView$1(SuggestQuery.java:78) ~[rest.jar:?]
	at whelk.search2.SuggestQuery.getPartialCollectionView(SuggestQuery.java:81) ~[rest.jar:?]
	at whelk.search2.Query.collectResults(Query.java:111) ~[rest.jar:?]
	at whelk.rest.api.SearchUtils2.doSearch(SearchUtils2.java:41) ~[rest.jar:?]
	at whelk.rest.api.SiteSearch.findData(SiteSearch.java:138) ~[rest.jar:?]
	at whelk.rest.api.Crud.handleQuery(Crud.java:145) ~[rest.jar:?]
	at whelk.rest.api.Crud.doGet2(Crud.java:123) ~[rest.jar:?]
	at whelk.rest.api.Crud.doGet(Crud.java:103) ~[rest.jar:?]
...

@andersju andersju requested review from kwahlin and olovy December 11, 2025 09:45
@kwahlin kwahlin changed the base branch from develop to feature/typenormalization December 11, 2025 10:01
Copy link
Contributor

@kwahlin kwahlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's merge this and fix the actual problem later.

@andersju andersju merged commit 283c99f into feature/typenormalization Dec 11, 2025
1 check passed
@andersju andersju deleted the fix/suggestquery-prevent-out-of-bounds branch December 11, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants