Package com.apple.foundationdb.record.lucene


package com.apple.foundationdb.record.lucene
Support for LUCENE indexes and queries.

Lucene indexes are backed by FDB, using FDBDirectory to implement a virtual file system holding the inverted index files. This is not fundamental, though. This maintainer used standard IndexWriter and IndexReader, gotten with FDBDirectoryManager.getIndexWriter(com.apple.foundationdb.tuple.Tuple, java.lang.Integer, com.apple.foundationdb.record.lucene.LuceneAnalyzerWrapper) getIndexWriter}, for interfacing to Lucene.

The index definition can be grouped. Each group represents an entirely separate Lucene index.

Within a group, each record is represented by a single Lucene document. Fields to be included in the document are given by a concat expression. Unlike most indexes, the order of fields here does not matter for what queries are possible. Repeated record fields turn into multiple document fields. Fields in nested submessages, possibly repeated, are flattened into document fields with longer field names, representing the path through the record.

Basic support for correlation is provided by allowing a nested field's string value to contribute to the document field name. This is well suited to map-like fields where the keys are from a small, known set.

Fields are designated for full text tokenization, for storage in the Lucene document, and as refining field naming, by means of function key expressions.

The standard form of a Lucene index scan is a Lucene search query. A special LucenePlanner is able to synthesize these from regular query expressions and Lucene search syntax.

See Also: