示例#1
0
 private void process(Object entity) {
   IndexFilterChecker checker = new IndexFilterChecker(entity);
   if (checker.needIndex()) {
     Document doc = new Document();
     IndexCreator creator = new IndexCreator(entity, "");
     creator.create(doc);
     try {
       this.writer.addDocument(doc);
     } catch (CorruptIndexException ex) {
       LOG.error("IndexWriter can not add a document to the lucene index", ex);
     } catch (IOException ex) {
       LOG.error("IndexWriter can not add a document to the lucene index", ex);
     }
   }
 }