Commit cd42c94f authored by Matija Obreza's avatar Matija Obreza

Mini fixes to make stuff work

parent cf10361f
...@@ -181,6 +181,6 @@ public class SearchController { ...@@ -181,6 +181,6 @@ public class SearchController {
} }
} }
return "/search2/index"; return "/search/index2";
} }
} }
...@@ -106,7 +106,7 @@ public class ElasticSearchController { ...@@ -106,7 +106,7 @@ public class ElasticSearchController {
elasticService.regenerateIndexes(); elasticService.regenerateIndexes();
return "redirect:/admin/elastic/"; return "redirect:/admin/elastic/";
} }
/** /**
* Completely recreate Elasticsearch indexes: create, index, re-alias. * Completely recreate Elasticsearch indexes: create, index, re-alias.
* *
...@@ -126,24 +126,15 @@ public class ElasticSearchController { ...@@ -126,24 +126,15 @@ public class ElasticSearchController {
* @throws IOException * @throws IOException
*/ */
@RequestMapping(method = RequestMethod.POST, value = "/action", params = { "reindex=accn", "filter" }) @RequestMapping(method = RequestMethod.POST, value = "/action", params = { "reindex=accn", "filter" })
public String reindexElasticFiltered(@RequestParam(value = "filter", required = true) String jsonFilter, public String reindexElasticFiltered(@RequestParam(value = "filter", required = true) String jsonFilter) throws IOException {
@RequestParam(value = "type", required = true) String type) throws IOException {
FilterHandler.AppliedFilters filters = mapper.readValue(jsonFilter, FilterHandler.AppliedFilters.class); FilterHandler.AppliedFilters filters = mapper.readValue(jsonFilter, FilterHandler.AppliedFilters.class);
if (type.equals("All")) { elasticService.reindex(filters);
elasticService.reindex(filters);
fullTextSearchService.regenerateIndexes();
} else if (type.equals(Accession.class.getName())) {
elasticService.reindex(filters);
} else {
fullTextSearchService.reindex(type);
}
return "redirect:/admin/elastic/"; return "redirect:/admin/elastic/";
} }
/** /**
* This method refreshes data in the currently active index. It is very * This method refreshes data in the currently active index. It is very
* handy when having to refresh part of ES after direct database update. * handy when having to refresh part of ES after direct database update.
...@@ -163,7 +154,6 @@ public class ElasticSearchController { ...@@ -163,7 +154,6 @@ public class ElasticSearchController {
return "redirect:/admin/elastic/"; return "redirect:/admin/elastic/";
} }
/** /**
* Clear ES queue * Clear ES queue
* *
......
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