org.mtzky.lucene
クラス LuceneIndexSearcher<E>

java.lang.Object
  上位を拡張 org.apache.lucene.search.Searcher
      上位を拡張 org.apache.lucene.search.IndexSearcher
          上位を拡張 org.mtzky.lucene.LuceneIndexSearcher<E>
型パラメータ:
E - entity
すべての実装されたインタフェース:
Closeable, Searchable, Closable

public class LuceneIndexSearcher<E>
extends IndexSearcher
implements Closable

作成者:
mtzky

フィールドの概要
 
クラス org.apache.lucene.search.IndexSearcher から継承されたフィールド
docStarts, subReaders, subSearchers
 
コンストラクタの概要
LuceneIndexSearcher(Directory d, LuceneDocumentDesc<E> desc)
           
 
メソッドの概要
 void close()
           
 void closeWhenDone()
           Signals that this instance may really close when all open() calls have been balanced with a call to close().
 LuceneIndexSearcherResponse<E> find(LuceneIndexSearcherRequest req)
           Finds by LuceneIndexSearcherRequest.
 LuceneIndexSearcherResponse<E> find(Query query)
           Finds the top LuceneIndexSearcherRequest.DEFAULT_LIMIT hits for query.
 LuceneIndexSearcherResponse<E> find(String query)
           Finds the top LuceneIndexSearcherRequest.DEFAULT_LIMIT hits for query.
 FluentIndexSearcherRequest<E> findBy()
           Returns FluentIndexSearcherRequest as the fluent interface.
 E findById(Object value)
           Finds the specified (top one) hit by ID field with value.
 boolean isClosed()
           
protected  void open()
           This should be called whenever this instances is passed as a new IndexSearcher.
 
クラス org.apache.lucene.search.IndexSearcher から継承されたメソッド
createWeight, doc, doc, docFreq, explain, explain, gatherSubReaders, getIndexReader, getSimilarity, getSubReaders, maxDoc, rewrite, search, search, search, search, search, search, search, search, search, search, setDefaultFieldSortScoring, setSimilarity
 
クラス org.apache.lucene.search.Searcher から継承されたメソッド
docFreqs
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

LuceneIndexSearcher

public LuceneIndexSearcher(Directory d,
                           LuceneDocumentDesc<E> desc)
                    throws CorruptIndexException,
                           IOException
パラメータ:
d - Document
desc - LuceneDocumentDesc
例外:
CorruptIndexException
IOException
メソッドの詳細

findBy

public FluentIndexSearcherRequest<E> findBy()

Returns FluentIndexSearcherRequest as the fluent interface. For example:

 LuceneIndexSearcherResponse res = searcher.findBy()
        .query("text: lucene")
        .query("text: mtzky", BooleanClause.Occur.MUST_NOT)
        .filter(...)
        .limit(100)
        .sort("id", true)
        .execute();
 

戻り値:
FluentIndexSearcherRequest

find

public LuceneIndexSearcherResponse<E> find(String query)
                                    throws CorruptIndexException,
                                           IOException,
                                           ParseException

Finds the top LuceneIndexSearcherRequest.DEFAULT_LIMIT hits for query.

パラメータ:
query - to search
戻り値:
Entities hit by query
例外:
CorruptIndexException
IOException
ParseException

find

public LuceneIndexSearcherResponse<E> find(Query query)
                                    throws CorruptIndexException,
                                           IOException

Finds the top LuceneIndexSearcherRequest.DEFAULT_LIMIT hits for query.

パラメータ:
query - to search
戻り値:
Entities hit by query
例外:
CorruptIndexException
IOException

find

public LuceneIndexSearcherResponse<E> find(LuceneIndexSearcherRequest req)
                                    throws CorruptIndexException,
                                           IOException

Finds by LuceneIndexSearcherRequest.

パラメータ:
req -
戻り値:
Entities hit by LuceneIndexSearcherRequest
例外:
CorruptIndexException
IOException
関連項目:
findBy()

findById

public E findById(Object value)
           throws CorruptIndexException,
                  IOException

Finds the specified (top one) hit by ID field with value. If not hit, returns null.

パラメータ:
value - to search
戻り値:
entity hit by ID field with value
例外:
CorruptIndexException
IOException

open

protected void open()

This should be called whenever this instances is passed as a new IndexSearcher. Only when each call to open() is balanced with a call to close(), and closeWhenDone() has been called, will super.close() be called.


isClosed

public boolean isClosed()
定義:
インタフェース Closable 内の isClosed

close

public void close()
           throws IOException
定義:
インタフェース Closeable 内の close
定義:
インタフェース Searchable 内の close
オーバーライド:
クラス IndexSearcher 内の close
例外:
IOException

closeWhenDone

public void closeWhenDone()
                   throws IOException

Signals that this instance may really close when all open() calls have been balanced with a call to close().

例外:
IOException


Copyright (C) 2010-2011 Mtzky. AllRights Reserved.