Constructor IndexSearcher
IndexSearcher(Directory)
Creates a searcher searching the index in the named directory, with readOnly=true
Declaration
public IndexSearcher(Directory path)
Parameters
Type | Name | Description |
---|---|---|
Directory | path |
IndexSearcher(Directory, Boolean)
Creates a searcher searching the index in the named directory. You should pass readOnly=true, since it gives much better concurrent performance, unless you intend to do write operations (delete documents or change norms) with the underlying IndexReader.
Declaration
public IndexSearcher(Directory path, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
Directory | path | directory where IndexReader will be opened |
System.Boolean | readOnly | if true, the underlying IndexReader will be opened readOnly |
IndexSearcher(IndexReader)
Creates a searcher searching the provided index
Note that the underlying IndexReader is not closed, if IndexSearcher was constructed with IndexSearcher(IndexReader r). If the IndexReader was supplied implicitly by specifying a directory, then the IndexReader gets closed.
Declaration
public IndexSearcher(IndexReader r)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | r |
IndexSearcher(IndexReader, IndexReader[], Int32[])
Expert: directly specify the reader, subReaders and their DocID starts
NOTE: This API is experimental and might change in incompatible ways in the next release
Declaration
public IndexSearcher(IndexReader reader, IndexReader[] subReaders, int[] docStarts)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | |
IndexReader[] | subReaders | |
System.Int32[] | docStarts |