Include search corrections in API.

This commit is contained in:
FireMaskterK 2021-10-10 00:24:29 +01:00
parent 2c7baa0710
commit 022a0af007
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
2 changed files with 11 additions and 3 deletions

View File

@ -407,8 +407,8 @@ public class ResponseHelper {
Page nextpage = info.getNextPage();
return Constants.mapper
.writeValueAsBytes(new SearchResults(items, Constants.mapper.writeValueAsString(nextpage)));
return Constants.mapper.writeValueAsBytes(new SearchResults(items,
Constants.mapper.writeValueAsString(nextpage), info.getSearchSuggestion(), info.isCorrectedSearch()));
}

View File

@ -5,10 +5,18 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList;
public class SearchResults {
public ObjectArrayList<Object> items;
public String nextpage;
public String nextpage, suggestion;
public boolean corrected;
public SearchResults(ObjectArrayList<Object> items, String nextpage) {
this.nextpage = nextpage;
this.items = items;
}
public SearchResults(ObjectArrayList<Object> items, String nextpage, String suggestion, boolean corrected) {
this.items = items;
this.nextpage = nextpage;
this.suggestion = suggestion;
this.corrected = corrected;
}
}