Skip to content

Commit

Permalink
[SHIBUI-660]
Browse files Browse the repository at this point in the history
Removed unneeded method. Updating lucene is handled in 723.
  • Loading branch information
Bill Smith committed Aug 20, 2018
1 parent 3551b54 commit aa4aba9
Showing 1 changed file with 0 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,45 +156,4 @@ private static URI getResourceUriFor(MetadataResolver resolver) {
.build()
.toUri();
}

private void updateLucene(MetadataResolver resolver) throws ComponentInitializationException {
IndexWriter indexWriter = null;
try {
indexWriter = indexWriterService.getIndexWriter(resolver.getResourceId());
} catch (IOException e) {
throw new ComponentInitializationException(e);
}

// add documents to indexWriter .. for each what?
/*
for () {
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
try {
indexWriter.addDocument(document);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
*/

// if document exists
// indexWriter.updateDocument(term, document) <-- what's the term?
// else, create...
Document document = new Document();
document.add(new StringField("id", resolver.getResourceId(), Field.Store.YES));

try {
indexWriter.addDocument(document);
} catch (IOException e) {
throw new ComponentInitializationException(e);
}

try {
indexWriter.commit();
} catch (IOException e) {
throw new ComponentInitializationException(e);
}
}
}

0 comments on commit aa4aba9

Please sign in to comment.