001
014
015 package com.liferay.portal.search.lucene;
016
017 import java.io.IOException;
018 import java.io.InputStream;
019 import java.io.OutputStream;
020
021 import java.util.Collection;
022
023 import org.apache.lucene.document.Document;
024 import org.apache.lucene.index.Term;
025 import org.apache.lucene.search.IndexSearcher;
026 import org.apache.lucene.store.Directory;
027
028
032 public interface IndexAccessor {
033
034 public static final long DEFAULT_LAST_GENERATION = -1;
035
036 public IndexSearcher acquireIndexSearcher() throws IOException;
037
038 public void addDocument(Document document) throws IOException;
039
040 public void addDocuments(Collection<Document> documents) throws IOException;
041
042 public void close();
043
044 public void delete();
045
046 public void deleteDocuments(Term term) throws IOException;
047
048 public void dumpIndex(OutputStream outputStream) throws IOException;
049
050 public long getCompanyId();
051
052 public long getLastGeneration();
053
054 public Directory getLuceneDir();
055
056 public void invalidate();
057
058 public void loadIndex(InputStream inputStream) throws IOException;
059
060 public void releaseIndexSearcher(IndexSearcher indexSearcher)
061 throws IOException;
062
063 public void updateDocument(Term term, Document document) throws IOException;
064
065 }