engine.IndexWriter

Inherited lucene IndexWriter.

Usage

Source

engine.IndexWriter()

Supports setting fields parameters explicitly, so documents can be represented as dictionaries.

Parameters

directory

directory path or lucene Directory mode: file mode (rwa), except updating (+) is implied analyzer: lucene Analyzer, default StandardAnalyzer version: lucene Version argument passed to IndexWriterConfig, default is latest **attrs: additional attributes to set on IndexWriterConfig

Methods

Name Description
__iadd__() Add directory (or reader, searcher, writer) to index.
add() Add [document][lupyne.engine.indexers.IndexWriter.document] to index with optional boost.
check() Check and optionally fix unlocked index, returning lucene CheckIndex.Status.
delete() Remove documents which match given query or term.
document() Return lucene Document from mapping of field names to one or multiple values.
set() Assign settings to field name and return the field.
snapshot() Return context manager of an index commit snapshot.
update() Atomically delete documents which match given term

__iadd__()

Add directory (or reader, searcher, writer) to index.

Usage

Source

__iadd__(directory)

add()

Add [document][lupyne.engine.indexers.IndexWriter.document] to index with optional boost.

Usage

Source

add(document=(), **terms)

check()

Check and optionally fix unlocked index, returning lucene CheckIndex.Status.

Usage

Source

check(directory, repair=False)

delete()

Remove documents which match given query or term.

Usage

Source

delete(*query, **options)

Args: *query: [search][lupyne.engine.indexers.IndexSearcher.search] compatible query, or optimally a name and value **options: additional [parse][lupyne.engine.analyzers.Analyzer.parse] options


document()

Return lucene Document from mapping of field names to one or multiple values.

Usage

Source

document(items=(), **terms)

set()

Assign settings to field name and return the field.

Usage

Source

set(name, cls=Field, **settings)

Parameters

name

registered name of field cls: optional [Field][lupyne.engine.documents.Field] constructor **settings: stored, indexed, etc. options compatible with [Field][lupyne.engine.documents.Field]


snapshot()

Return context manager of an index commit snapshot.

Usage

Source

snapshot()

update()

Atomically delete documents which match given term

Usage

Source

update(name, value="", document=(), **terms)

and add the new [document][lupyne.engine.indexers.IndexWriter.document].