ome.services.fulltext
Class FullTextBridge

java.lang.Object
  extended by ome.services.fulltext.BridgeHelper
      extended by ome.services.fulltext.FullTextBridge
All Implemented Interfaces:
org.hibernate.search.bridge.FieldBridge, org.springframework.context.ApplicationEventPublisherAware

public class FullTextBridge
extends BridgeHelper

Primary definition of what will be indexed via Hibernate Search. This class is delegated to by the DetailsFieldBridge, and further delegates to classes as defined under "SearchBridges".

Since:
3.0-Beta3
Author:
Josh Moore, josh at glencoesoftware.com
See Also:
Parsers, Bridges
To do:
insert/update OR delete regular type OR annotated type OR originalfile

Field Summary
protected  Class<org.hibernate.search.bridge.FieldBridge>[] classes
           
protected  OriginalFilesService files
           
protected  Map<String,FileParser> parsers
           
 
Fields inherited from class ome.services.fulltext.BridgeHelper
COMBINED, log, publisher
 
Constructor Summary
FullTextBridge()
          Since this constructor provides the instance with no way of parsing OriginalFile binaries, all files will be assumed to have blank content.
FullTextBridge(OriginalFilesService files, Map<String,FileParser> parsers)
          Constructor which provides an empty set of custom bridges.
FullTextBridge(OriginalFilesService files, Map<String,FileParser> parsers, Class<org.hibernate.search.bridge.FieldBridge>[] bridgeClasses)
          Main constructor.
 
Method Summary
 void set_annotations(String name, ome.model.IObject object, Document document, org.hibernate.search.bridge.LuceneOptions opts)
          Walks the various Annotation instances attached to the object argument and adds various levels to the index.
 void set_custom(String name, ome.model.IObject object, Document document, org.hibernate.search.bridge.LuceneOptions opts)
          Loops over each field bridge class and calls its FieldBridge#set(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float) method.
 void set_details(String name, ome.model.IObject object, Document document, org.hibernate.search.bridge.LuceneOptions opts)
          Parses all ownership and time-based details to the index for the given object.
 void set_file(String name, ome.model.IObject object, Document document, org.hibernate.search.bridge.LuceneOptions opts)
          Uses #parse(OriginalFile) to get a Reader for the given file which is then passed to #add(Document, String, Reader, Float) using the field name "file".
 void set(String name, Object value, Document document, org.hibernate.search.bridge.LuceneOptions opts)
          Default implementation of the #set(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float) method which calls #set_file(String, IObject, Document, Store, org.apache.lucene.document.Field.Index, Float) #set_annotations(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float), #set_details(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float), and finally #set_custom(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float).
 
Methods inherited from class ome.services.fulltext.BridgeHelper
add, addContents, getProxiedObject, logger, parse, reindex, reindexAll, setApplicationEventPublisher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

files

protected final OriginalFilesService files

parsers

protected final Map<String,FileParser> parsers

classes

protected final Class<org.hibernate.search.bridge.FieldBridge>[] classes
Constructor Detail

FullTextBridge

public FullTextBridge()
Since this constructor provides the instance with no way of parsing OriginalFile binaries, all files will be assumed to have blank content. Further, no custom bridges are provided and so only the default indexing will take place.


FullTextBridge

public FullTextBridge(OriginalFilesService files,
                      Map<String,FileParser> parsers)
Constructor which provides an empty set of custom bridges.


FullTextBridge

public FullTextBridge(OriginalFilesService files,
                      Map<String,FileParser> parsers,
                      Class<org.hibernate.search.bridge.FieldBridge>[] bridgeClasses)
Main constructor.

Parameters:
files - OriginalFileServce for getting access to binary files.
parsers - List of FileParser instances which are currently configured.
bridgeClasses - set of bridge classes which will be instantiated via a no-arg constructor.
See Also:
Bridges
Method Detail

set

public void set(String name,
                Object value,
                Document document,
                org.hibernate.search.bridge.LuceneOptions opts)
Default implementation of the #set(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float) method which calls #set_file(String, IObject, Document, Store, org.apache.lucene.document.Field.Index, Float) #set_annotations(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float), #set_details(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float), and finally #set_custom(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float). as well as all annotations.

Specified by:
set in interface org.hibernate.search.bridge.FieldBridge
Specified by:
set in class BridgeHelper

set_file

public void set_file(String name,
                     ome.model.IObject object,
                     Document document,
                     org.hibernate.search.bridge.LuceneOptions opts)
Uses #parse(OriginalFile) to get a Reader for the given file which is then passed to #add(Document, String, Reader, Float) using the field name "file".

Parameters:
name -
object -
document -
store -
index -
boost -

set_annotations

public void set_annotations(String name,
                            ome.model.IObject object,
                            Document document,
                            org.hibernate.search.bridge.LuceneOptions opts)
Walks the various Annotation instances attached to the object argument and adds various levels to the index.

Parameters:
name -
object -
document -
store -
index -
boost -

set_details

public void set_details(String name,
                        ome.model.IObject object,
                        Document document,
                        org.hibernate.search.bridge.LuceneOptions opts)
Parses all ownership and time-based details to the index for the given object.

Parameters:
name -
object -
document -
store -
index -
boost -

set_custom

public void set_custom(String name,
                       ome.model.IObject object,
                       Document document,
                       org.hibernate.search.bridge.LuceneOptions opts)
Loops over each field bridge class and calls its FieldBridge#set(String, Object, Document, Store, org.apache.lucene.document.Field.Index, Float) method. Any exceptions are logged but do not cancel execution.

Parameters:
name -
object -
document -
store -
index -
boost -


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.