Search in sources :

Example 6 with SearchException

use of net.jforum.exceptions.SearchException in project jforum2 by rafaelsteil.

the class LuceneIndexer method batchCreate.

public void batchCreate(Post post) {
    synchronized (MUTEX) {
        try {
            Document document = this.createDocument(post);
            this.ramWriter.addDocument(document);
            this.flushRAMDirectoryIfNecessary();
        } catch (IOException e) {
            throw new SearchException(e);
        }
    }
}
Also used : SearchException(net.jforum.exceptions.SearchException) IOException(java.io.IOException) Document(org.apache.lucene.document.Document)

Aggregations

IOException (java.io.IOException)6 SearchException (net.jforum.exceptions.SearchException)6 ArrayList (java.util.ArrayList)2 IndexWriter (org.apache.lucene.index.IndexWriter)2 StringReader (java.io.StringReader)1 List (java.util.List)1 Token (org.apache.lucene.analysis.Token)1 TokenStream (org.apache.lucene.analysis.TokenStream)1 StandardAnalyzer (org.apache.lucene.analysis.standard.StandardAnalyzer)1 Document (org.apache.lucene.document.Document)1 QueryParser (org.apache.lucene.queryParser.QueryParser)1 Hits (org.apache.lucene.search.Hits)1 Query (org.apache.lucene.search.Query)1 TermQuery (org.apache.lucene.search.TermQuery)1 RAMDirectory (org.apache.lucene.store.RAMDirectory)1