org.compass.core.lucene.util
Class LuceneUtils

java.lang.Object
  extended by org.compass.core.lucene.util.LuceneUtils

public abstract class LuceneUtils
extends Object

Author:
kimchy

Constructor Summary
LuceneUtils()
           
 
Method Summary
static Analyzer addAllProperty(InternalResource resource, Analyzer analyzer, ResourceMapping resourceMapping, LuceneSearchEngine searchEngine)
           
static void addExtendedProeprty(Resource resource, ResourceMapping resourceMapping, LuceneSearchEngineFactory searchEngineFactory)
           
static void applyBoostIfNeeded(InternalResource resource, SearchEngineFactory searchEngineFactory)
           
static Query buildResourceLoadQuery(ResourceKey resourceKey)
           
static void clearLocks(Lock[] locks)
           
static void createResource(IndexWriter indexWriter, Resource resource, Analyzer analyzer)
           
static boolean deleteDir(File dir)
           
static List<String> findPropertyValues(IndexReader indexReader, String propertyName)
           
static Field.Index getFieldIndex(Property.Index index)
           
static Field.Store getFieldStore(Property.Store store)
           
static Field.TermVector getFieldTermVector(Property.TermVector termVector)
           
static Resource[] hitsToResourceArray(Hits hits, LuceneSearchEngine searchEngine)
           
static Resource[] hitsToResourceArray(TermDocs termDocs, IndexReader indexReader, LuceneSearchEngine searchEngine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneUtils

public LuceneUtils()
Method Detail

buildResourceLoadQuery

public static Query buildResourceLoadQuery(ResourceKey resourceKey)

hitsToResourceArray

public static Resource[] hitsToResourceArray(TermDocs termDocs,
                                             IndexReader indexReader,
                                             LuceneSearchEngine searchEngine)
                                      throws IOException
Throws:
IOException

hitsToResourceArray

public static Resource[] hitsToResourceArray(Hits hits,
                                             LuceneSearchEngine searchEngine)
                                      throws SearchEngineException
Throws:
SearchEngineException

applyBoostIfNeeded

public static void applyBoostIfNeeded(InternalResource resource,
                                      SearchEngineFactory searchEngineFactory)

createResource

public static void createResource(IndexWriter indexWriter,
                                  Resource resource,
                                  Analyzer analyzer)
                           throws SearchEngineException
Throws:
SearchEngineException

addExtendedProeprty

public static void addExtendedProeprty(Resource resource,
                                       ResourceMapping resourceMapping,
                                       LuceneSearchEngineFactory searchEngineFactory)

addAllProperty

public static Analyzer addAllProperty(InternalResource resource,
                                      Analyzer analyzer,
                                      ResourceMapping resourceMapping,
                                      LuceneSearchEngine searchEngine)
                               throws SearchEngineException
Throws:
SearchEngineException

findPropertyValues

public static List<String> findPropertyValues(IndexReader indexReader,
                                              String propertyName)
                                       throws SearchEngineException
Throws:
SearchEngineException

getFieldIndex

public static Field.Index getFieldIndex(Property.Index index)
                                 throws SearchEngineException
Throws:
SearchEngineException

getFieldStore

public static Field.Store getFieldStore(Property.Store store)
                                 throws SearchEngineException
Throws:
SearchEngineException

getFieldTermVector

public static Field.TermVector getFieldTermVector(Property.TermVector termVector)
                                           throws SearchEngineException
Throws:
SearchEngineException

deleteDir

public static boolean deleteDir(File dir)

clearLocks

public static void clearLocks(Lock[] locks)


Copyright (c) 2004-2008 The Compass Project.