Class FullText

  • All Implemented Interfaces:
    java.io.Serializable, Executor.Work
    Direct Known Subclasses:
    SomeMustNone

    public class FullText
    extends SearchAction
    Search based on Lucene's Query class. Takes a Google-like search string and returns fully formed objects via Hibernate Search.
    Since:
    3.0-Beta3
    See Also:
    Serialized Form
    • Constructor Detail

      • FullText

        public FullText​(SearchValues values,
                        java.lang.String fields,
                        java.lang.String from,
                        java.lang.String to,
                        java.lang.String dateType,
                        java.lang.String query,
                        java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
        Constructs a new instance; Builds a Lucence query with the provided arguments and passes it on the Lucene parser
        Parameters:
        values -
        fields - Comma separated field names (name, description, etc.)
        from - Date range from in form YYYYMMDD
        to - Date range to in form YYYYMMDD
        dateType - Type of date Search.DATE_TYPE_ACQUISITION or Search.DATE_TYPE_IMPORT
        query - The terms to search for
        analyzer -
      • FullText

        public FullText​(SearchValues values,
                        java.lang.String query,
                        java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
        Creates a new instance; Passes the query directly on to the Lucene parser.
        Parameters:
        values -
        query -
        analyzer -
    • Method Detail

      • initializeQuery

        protected void initializeQuery​(org.hibernate.search.FullTextQuery ftQuery)
        Allows settings offset and limit on the query. The default implementation calls setProjection with SCORE and ID, which MUST BE the first two projection values. Any overriding method may add further projections but must start with these two.
        Parameters:
        ftQuery -
      • doWork

        @Transactional(readOnly=true)
        public java.lang.Object doWork​(org.hibernate.Session s,
                                       ome.system.ServiceFactory sf)
        Description copied from interface: Executor.Work
        Work method. Must return all results coming from Hibernate via the Object return method.
        Parameters:
        s - non null.
        sf - non null.
        Returns:
        Any results which will be used by non-wrapped code.
      • getScore

        public java.lang.Float getScore​(ome.model.IObject object)
      • getTotalSize

        public java.lang.Integer getTotalSize​(ome.model.IObject object)
      • getProjections

        public java.lang.Object[] getProjections​(ome.model.IObject object)