Analyzer
that does no additional (not even lowercasing) other than
the term itself and its synonyms.
Splits tokens into synonyms at the same position, taking in a simple map from a String to a list of its synonyms (which doesn't need to contain the original token).
Splits tokens into synonyms at the same position, taking in a simple map from a String to a list of its synonyms (which doesn't need to contain the original token).
This has been heavily influenced by SynonymFilter from "Lucene in
Action" and upgraded for Lucene 4 because bundled
requires the
mappings to be built up in advance.org.apache.lucene.analysis.synonym.SynonymFilter
Apologies for all the mutable state: we're interacting with a mutable Java API.
Lightweight convenience wrapper over Lucene that does some sanity
checking, sets up per-field Analyzer
s and gives access to
CRUD-like operations.
Lightweight convenience wrapper over Lucene that does some sanity
checking, sets up per-field Analyzer
s and gives access to
CRUD-like operations. Callers are expected to perform their own
marshalling and unmarshalling for Lucene's Query
and Document
types.
This class is thread safe. Only one instance is allowed **on the operating system** (not just the JVM) for the same path. Lucene manages a file lock to mitigate the risk of this happening.
Technical note: Lucene is an excellent INDEX store, but is not a database. Prefer using the DatabaseProvider where possible and only fall back to using the index when SQL doesn't cut it. Excellent examples of using an index are for creating multiple representations of the same column, or for allowing allow/deny filtering rules based on tags.