com.liferay.portal.search.lucene
Class LuceneUtil

java.lang.Object
  extended by com.liferay.portal.search.lucene.LuceneUtil

public class LuceneUtil
extends java.lang.Object

View Source

Author:
Brian Wing Shun Chan, Harry Mark

Method Summary
 void _delete(long companyId)
           
static void acquireLock(long companyId)
           
static void addDate(org.apache.lucene.document.Document doc, java.lang.String field, java.util.Date value)
           
static void addExactTerm(org.apache.lucene.search.BooleanQuery booleanQuery, java.lang.String field, long value)
           
static void addExactTerm(org.apache.lucene.search.BooleanQuery booleanQuery, java.lang.String field, java.lang.String value)
           
static void addKeyword(org.apache.lucene.document.Document doc, java.lang.String field, double value)
           
static void addKeyword(org.apache.lucene.document.Document doc, java.lang.String field, long value)
           
static void addKeyword(org.apache.lucene.document.Document doc, java.lang.String field, java.lang.String value)
           
static void addKeyword(org.apache.lucene.document.Document doc, java.lang.String field, java.lang.String[] values)
           
static void addModifiedDate(org.apache.lucene.document.Document doc)
           
static void addRequiredTerm(org.apache.lucene.search.BooleanQuery booleanQuery, java.lang.String field, long value)
           
static void addRequiredTerm(org.apache.lucene.search.BooleanQuery booleanQuery, java.lang.String field, java.lang.String value)
           
static void addTerm(org.apache.lucene.search.BooleanQuery booleanQuery, java.lang.String field, long value)
           
static void addTerm(org.apache.lucene.search.BooleanQuery booleanQuery, java.lang.String field, java.lang.String value)
           
static void addText(org.apache.lucene.document.Document doc, java.lang.String field, long value)
           
static void addText(org.apache.lucene.document.Document doc, java.lang.String field, java.lang.String value)
           
static void checkLuceneDir(long companyId)
           
static void delete(long companyId)
           
static void deleteDocuments(long companyId, org.apache.lucene.index.Term term)
           
static org.apache.lucene.analysis.Analyzer getAnalyzer()
           
static org.apache.lucene.store.Directory getLuceneDir(long companyId)
           
static org.apache.lucene.index.IndexReader getReader(long companyId)
           
static org.apache.lucene.search.IndexSearcher getSearcher(long companyId)
           
static org.apache.lucene.index.IndexWriter getWriter(long companyId)
           
static org.apache.lucene.index.IndexWriter getWriter(long companyId, boolean create)
           
static void releaseLock(long companyId)
           
static void write(org.apache.lucene.index.IndexWriter writer)
           
static void write(long companyId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

acquireLock

public static void acquireLock(long companyId)

addDate

public static void addDate(org.apache.lucene.document.Document doc,
                           java.lang.String field,
                           java.util.Date value)

addExactTerm

public static void addExactTerm(org.apache.lucene.search.BooleanQuery booleanQuery,
                                java.lang.String field,
                                long value)

addExactTerm

public static void addExactTerm(org.apache.lucene.search.BooleanQuery booleanQuery,
                                java.lang.String field,
                                java.lang.String value)

addKeyword

public static void addKeyword(org.apache.lucene.document.Document doc,
                              java.lang.String field,
                              double value)

addKeyword

public static void addKeyword(org.apache.lucene.document.Document doc,
                              java.lang.String field,
                              long value)

addKeyword

public static void addKeyword(org.apache.lucene.document.Document doc,
                              java.lang.String field,
                              java.lang.String value)

addKeyword

public static void addKeyword(org.apache.lucene.document.Document doc,
                              java.lang.String field,
                              java.lang.String[] values)

addRequiredTerm

public static void addRequiredTerm(org.apache.lucene.search.BooleanQuery booleanQuery,
                                   java.lang.String field,
                                   long value)

addRequiredTerm

public static void addRequiredTerm(org.apache.lucene.search.BooleanQuery booleanQuery,
                                   java.lang.String field,
                                   java.lang.String value)

addModifiedDate

public static void addModifiedDate(org.apache.lucene.document.Document doc)

addTerm

public static void addTerm(org.apache.lucene.search.BooleanQuery booleanQuery,
                           java.lang.String field,
                           long value)
                    throws org.apache.lucene.queryParser.ParseException
Throws:
org.apache.lucene.queryParser.ParseException

addTerm

public static void addTerm(org.apache.lucene.search.BooleanQuery booleanQuery,
                           java.lang.String field,
                           java.lang.String value)
                    throws org.apache.lucene.queryParser.ParseException
Throws:
org.apache.lucene.queryParser.ParseException

addText

public static void addText(org.apache.lucene.document.Document doc,
                           java.lang.String field,
                           long value)

addText

public static void addText(org.apache.lucene.document.Document doc,
                           java.lang.String field,
                           java.lang.String value)

checkLuceneDir

public static void checkLuceneDir(long companyId)

delete

public static void delete(long companyId)

deleteDocuments

public static void deleteDocuments(long companyId,
                                   org.apache.lucene.index.Term term)
                            throws java.io.IOException
Throws:
java.io.IOException

getAnalyzer

public static org.apache.lucene.analysis.Analyzer getAnalyzer()

getLuceneDir

public static org.apache.lucene.store.Directory getLuceneDir(long companyId)

getReader

public static org.apache.lucene.index.IndexReader getReader(long companyId)
                                                     throws java.io.IOException
Throws:
java.io.IOException

getSearcher

public static org.apache.lucene.search.IndexSearcher getSearcher(long companyId)
                                                          throws java.io.IOException
Throws:
java.io.IOException

getWriter

public static org.apache.lucene.index.IndexWriter getWriter(long companyId)
                                                     throws java.io.IOException
Throws:
java.io.IOException

getWriter

public static org.apache.lucene.index.IndexWriter getWriter(long companyId,
                                                            boolean create)
                                                     throws java.io.IOException
Throws:
java.io.IOException

releaseLock

public static void releaseLock(long companyId)

write

public static void write(long companyId)

write

public static void write(org.apache.lucene.index.IndexWriter writer)
                  throws java.io.IOException
Throws:
java.io.IOException

_delete

public void _delete(long companyId)