Commit 816559c2 authored by Aleksandr Ivanov's avatar Aleksandr Ivanov

added fuzzy short name search

parent 972d965a
......@@ -72,11 +72,12 @@ public class InfoSystemController {
PageRequest pageable = new PageRequest(0, 10);
FilterRequest shortNameExact = new FilterRequest("short_name,ilike," + paramToRestEndpoint, "desc", "id");
FilterRequest fuzzyNameExact = new FilterRequest("short_name,ilike,%" + searchTerm + "%", "desc", "id");
FilterRequest nameExact = new FilterRequest("name,ilike," + paramToRestEndpoint, "desc", "id");
FilterRequest nameFuzzy = new FilterRequest("name,ilike,%" + searchTerm + "%", "desc", "id");
List<InfoSystem> foundResults = new ArrayList<>();
for (FilterRequest filterRequest : Arrays.asList(shortNameExact, nameExact, nameFuzzy)) {
for (FilterRequest filterRequest : Arrays.asList(shortNameExact, fuzzyNameExact, nameExact, nameFuzzy)) {
searchInfoSystemsByFilter(pageable, filterRequest)
.forEach(infoSystem -> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment