public Indexer(String type) throws IOException {
this.type = type;
}
public void index(T item) throws CorruptIndexException, IOException, ItemException {
IndexPathProperty pathIndex = new IndexPathProperty();
FSDirectory directory = FSDirectory.open(new File(pathIndex.getValue()));
IndexWriter writer = new IndexWriter(directory, new StandardAnalyzer(Version.LUCENE_30), IndexWriter.MaxFieldLength.LIMITED);
writer.updateDocument(new Term(type + "_id", item.getId().toString()), item.getDocument());
writer.optimize();
writer.close();