Skip to content

Commit

Permalink
HTM-1413: when there are no attributes left indexing could crash (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins authored Jan 14, 2025
2 parents a0b26f1 + d978728 commit 6a6961b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/tailormap/api/solr/SolrHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ public SearchIndex addFeatureTypeIndex(
Query q = new Query(fs.getName().toString());
// filter out any hidden properties (there should be none though)
tmFeatureType.getSettings().getHideAttributes().forEach(propertyNames::remove);
if (propertyNames.isEmpty()) {
logger.warn("No valid properties to index for featuretype: {}, bailing out.", tmFeatureType.getName());
return searchIndexRepository.save(searchIndex
.setStatus(SearchIndex.Status.ERROR)
.setSummary(summary.errorMessage("No valid properties to index")));
}
q.setPropertyNames(List.copyOf(propertyNames));
q.setStartIndex(0);
// TODO: make maxFeatures configurable?
Expand Down

0 comments on commit 6a6961b

Please sign in to comment.