@Deprecated
public abstract class BridgeHelper
extends java.lang.Object
implements org.hibernate.search.bridge.FieldBridge, org.springframework.context.ApplicationEventPublisherAware
FieldBridge
implementations.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMBINED
Deprecated.
Name of the
Field which contains the union of all fields. |
protected org.slf4j.Logger |
log
Deprecated.
|
protected org.springframework.context.ApplicationEventPublisher |
publisher
Deprecated.
|
Constructor and Description |
---|
BridgeHelper()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(org.apache.lucene.document.Document d,
java.lang.String field,
java.lang.String value,
org.hibernate.search.bridge.LuceneOptions opts)
Deprecated.
Helper method which takes the parameters from the
set(String, Object, Document, LuceneOptions)
method (possibly modified) as well as the parsed String value
which should be added to the index, and adds two fields. |
protected void |
addContents(org.apache.lucene.document.Document d,
java.lang.String name,
ome.model.core.OriginalFile file,
ome.io.nio.OriginalFilesService files,
java.util.Map<java.lang.String,FileParser> parsers,
org.hibernate.search.bridge.LuceneOptions opts)
Deprecated.
Second helper method used when parsing files.
|
protected void |
addEnumIfNotNull(org.apache.lucene.document.Document d,
java.lang.String field,
ome.model.IEnum value,
org.hibernate.search.bridge.LuceneOptions opts)
Deprecated.
Helper method which takes the parameters from the
set(String, Object, Document, LuceneOptions)
method (possibly modified) as well as the IEnum value
which should be added to the index, and adds two fields. |
protected void |
addIfNotNull(org.apache.lucene.document.Document d,
java.lang.String field,
java.lang.String value,
org.hibernate.search.bridge.LuceneOptions opts)
Deprecated.
Helper method which takes the parameters from the
set(String, Object, Document, LuceneOptions)
method (possibly modified) as well as the parsed String value
which should be added to the index, and adds two fields. |
static <T> T |
getProxiedObject(T proxy)
Deprecated.
Simpler wrapper to handle superclass proxy objects (e.g.
|
org.slf4j.Logger |
logger()
Deprecated.
|
protected java.lang.Iterable<java.io.Reader> |
parse(ome.model.core.OriginalFile file,
ome.io.nio.OriginalFilesService files,
java.util.Map<java.lang.String,FileParser> parsers)
Deprecated.
Attempts to parse the given
OriginalFile . |
protected <T extends ome.model.IObject> |
reindex(T object)
Deprecated.
Publishes a
ReindexMessage which will get processed
asynchronously. |
protected <T extends ome.model.IObject> |
reindexAll(java.util.List<T> list)
Deprecated.
Publishes a
ReindexMessage which will get processed
asynchronously. |
abstract void |
set(java.lang.String name,
java.lang.Object value,
org.apache.lucene.document.Document document,
org.hibernate.search.bridge.LuceneOptions opts)
Deprecated.
Method to be implemented by all
bridges . |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
Deprecated.
|
public static final java.lang.String COMBINED
Field
which contains the union of all fields. This is
also the default search field, so users need not append the value to
search the full index. A field name need only be added to a search to
eliminate other fields.protected final org.slf4j.Logger log
protected org.springframework.context.ApplicationEventPublisher publisher
public static <T> T getProxiedObject(T proxy)
public final org.slf4j.Logger logger()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
setApplicationEventPublisher
in interface org.springframework.context.ApplicationEventPublisherAware
public abstract void set(java.lang.String name, java.lang.Object value, org.apache.lucene.document.Document document, org.hibernate.search.bridge.LuceneOptions opts)
bridges
. The "value"
argument is an active Hibernate object, and so the full graph can be
walked.set
in interface org.hibernate.search.bridge.FieldBridge
protected void addIfNotNull(org.apache.lucene.document.Document d, java.lang.String field, java.lang.String value, org.hibernate.search.bridge.LuceneOptions opts)
set(String, Object, Document, LuceneOptions)
method (possibly modified) as well as the parsed String
value
which should be added to the index, and adds two fields. One with the
given field name and another to the COMBINED
field which is the
default search provided to users. In addition to storing the value as is,
another Field
will be added for both the named and
COMBINED
cases using a StringReader
to allow Lucene to
tokenize the String
.d
- Document as passed to the set method. Do not modify.field
- Field name which probably should be modified. If
this value is null, then the "value" will only be added to the
COMBINED
field.value
- Value which has been parsed out for this field. If null, then
this is a no-op.opts
- LuceneOptions, passed in from the runtime. If overriding on
the interface values is required, see SimpleLuceneOptions
protected void addEnumIfNotNull(org.apache.lucene.document.Document d, java.lang.String field, ome.model.IEnum value, org.hibernate.search.bridge.LuceneOptions opts)
set(String, Object, Document, LuceneOptions)
method (possibly modified) as well as the IEnum
value
which should be added to the index, and adds two fields. One with the
given field name and another to the COMBINED
field which is the
default search provided to users. In addition to storing the value as is,
another Field
will be added for both the named and
COMBINED
cases using a StringReader
to allow Lucene to
tokenize the String
.d
- Document as passed to the set method. Do not modify.field
- Field name which probably should be modified. If
this value is null, then the "value" will only be added to the
COMBINED
field.value
- IEnum
whose IEnum.getValue()
method will be called.
If null, then this is a no-op.opts
- LuceneOptions, passed in from the runtime. If overriding on
the interface values is required, see SimpleLuceneOptions
protected void add(org.apache.lucene.document.Document d, java.lang.String field, java.lang.String value, org.hibernate.search.bridge.LuceneOptions opts)
set(String, Object, Document, LuceneOptions)
method (possibly modified) as well as the parsed String
value
which should be added to the index, and adds two fields. One with the
given field name and another to the COMBINED
field which is the
default search provided to users. In addition to storing the value as is,
another Field
will be added for both the named and
COMBINED
cases using a StringReader
to allow Lucene to
tokenize the String
.d
- Document as passed to the set method. Do not modify.field
- Field name which probably should be modified. If
this value is null, then the "value" will only be added to the
COMBINED
field.value
- Value which has been parsed out for this field. Should
not be null. If you need to store a null value in
the index, use a null token like "null".opts
- LuceneOptions, passed in from the runtime. If overriding on
the interface values is required, see SimpleLuceneOptions
protected void addContents(org.apache.lucene.document.Document d, java.lang.String name, ome.model.core.OriginalFile file, ome.io.nio.OriginalFilesService files, java.util.Map<java.lang.String,FileParser> parsers, org.hibernate.search.bridge.LuceneOptions opts)
OriginalFile
will be passed to parse(OriginalFile, OriginalFilesService, Map)
to generate Reader
instances, which will be read until they
signal an end, however it is not the responsibility of this instance to
close the Readers since this happens asynchronously.
The contents of the file will be parsed both to COMBINED
and
"file.contents".d
- Document
as passed to set. Do not modify.name
- String to be used as the name of the field. If null, then
the contents will only be added to the COMBINED
Field
.file
- Non-null, possibly unloaded OriginalFile
which is used
to look up the file on disk.files
- OriginalFilesService
which knows how to find where this
OriginalFile
is stored on disk.parsers
- Map
of FileParser
instances to be used based
on the Format
of
the OriginalFile
opts
- The search option.protected <T extends ome.model.IObject> void reindex(T object)
ReindexMessage
which will get processed
asynchronously.protected <T extends ome.model.IObject> void reindexAll(java.util.List<T> list)
ReindexMessage
which will get processed
asynchronously.protected java.lang.Iterable<java.io.Reader> parse(ome.model.core.OriginalFile file, ome.io.nio.OriginalFilesService files, java.util.Map<java.lang.String,FileParser> parsers)
OriginalFile
. If any of the
necessary components is null, then it will return an empty, but not null
Iterable
. Also looks for the catch all parser under "*"file
- Can be null.