Commit 7ba96281 authored by Matija Obreza's avatar Matija Obreza
Browse files

Regenerate passport data index including historic=true

parent ebb6ccdd
......@@ -44,7 +44,9 @@ import org.genesys2.server.model.impl.Country;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.persistence.domain.GenesysLowlevelRepository;
import org.genesys2.server.service.ElasticSearchManagementService;
import org.genesys2.server.service.FilterConstants;
import org.genesys2.server.service.IndexAliasConstants;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilter;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilters;
import org.genesys2.server.service.worker.ElasticUpdater;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -183,7 +185,13 @@ public class ElasticSearchManagementServiceImpl implements ElasticSearchManageme
if (IndexAliasConstants.INDEX_FULLTEXT.equals(indexName)) {
reindex(REINDEX_TYPE_ALL);
} else if (IndexAliasConstants.INDEX_PASSPORT.equals(indexName)) {
reindex(new AppliedFilters());
AppliedFilters activeAndHistoric = new AppliedFilters();
activeAndHistoric.add(new AppliedFilter().setFilterName(FilterConstants.HISTORIC)
// true
.addFilterValue(new FilterHandler.LiteralValueFilter(true))
// false
.addFilterValue(new FilterHandler.LiteralValueFilter(false)));
reindex(activeAndHistoric);
}
realias(readAlias, fullTextIndexName);
......
......@@ -16,7 +16,7 @@
<h3>Accession data</h3>
<form method="post" action="<c:url value="/admin/elastic/action" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<input type="text" name="filter" placeholder="Genesys filter {}" value="{}" />
<input type="text" name="filter" placeholder="Genesys filter {}" value='{"historic":[true,false]}' />
<button type="submit" class="btn btn-default" value="accn" name="reindex">Reindex</button>
<button type="submit" class="btn btn-default" value="accn" name="regenerate">Regenerate</button>
</form>
......
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