Skip to content

Commit

Permalink
SHIBUI-997: Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Nov 19, 2018
1 parent 5b6ae71 commit eb05766
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,19 @@ public Iterable<EntityDescriptor> resolve(@Nullable CriteriaSet criteria) {
void addIndexedDescriptorsFromBackingStore(AbstractMetadataResolver.EntityBackingStore backingStore, String resourceId, IndexWriter indexWriter) throws ComponentInitializationException {
try {
indexWriter.deleteAll();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
for (String entityId : backingStore.getIndexedDescriptors().keySet()) {
Document document = new Document();
document.add(new StringField("id", entityId, Field.Store.YES));
document.add(new TextField("content", entityId, Field.Store.YES)); // TODO: change entityId to be content of entity descriptor block
document.add(new StringField("tag", resourceId, Field.Store.YES));
try {
indexWriter.addDocument(document);
} catch (IOException e) {
logger.error(e.getMessage(), e);
for (String entityId : backingStore.getIndexedDescriptors().keySet()) {
Document document = new Document();
document.add(new StringField("id", entityId, Field.Store.YES));
document.add(new TextField("content", entityId, Field.Store.YES)); // TODO: change entityId to be content of entity descriptor block
document.add(new StringField("tag", resourceId, Field.Store.YES));
try {
indexWriter.addDocument(document);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
}
try {
indexWriter.commit();
} catch (IOException e) {
logger.error(e.getMessage(), e);
throw new ComponentInitializationException(e);
}
}
Expand Down

0 comments on commit eb05766

Please sign in to comment.