Package ome.services.search
Class FullText
- java.lang.Object
-
- ome.services.search.SearchAction
-
- ome.services.search.FullText
-
- All Implemented Interfaces:
java.io.Serializable
,Executor.Work
- Direct Known Subclasses:
SomeMustNone
public class FullText extends SearchAction
Search based on Lucene'sQuery
class. Takes a Google-like search string and returns fully formed objects via Hibernate Search.- Since:
- 3.0-Beta3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALL_PROJECTIONS
static java.lang.String
TOTAL_SIZE
-
Fields inherited from class ome.services.search.SearchAction
chainedList, timeout, values
-
-
Constructor Summary
Constructors Constructor Description 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.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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
doWork(org.hibernate.Session s, ome.system.ServiceFactory sf)
Work method.java.lang.Object[]
getProjections(ome.model.IObject object)
java.lang.Float
getScore(ome.model.IObject object)
java.lang.Integer
getTotalSize(ome.model.IObject object)
protected void
initializeQuery(org.hibernate.search.FullTextQuery ftQuery)
Allows settings offset and limit on the query.-
Methods inherited from class ome.services.search.SearchAction
annotatedBetween, annotatedBetween, annotatedBy, annotatedBy, chainedSearch, copyOfValues, createdOrModified, createdOrModified, description, ids, ids, notNullOrLikeOrEqual, notNullOrLikeOrEqual, orderByAscending, orderByPath, ownerOrGroup, ownerOrGroup, setTimeout
-
-
-
-
Field Detail
-
ALL_PROJECTIONS
public static final java.lang.String ALL_PROJECTIONS
- See Also:
- Constant Field Values
-
TOTAL_SIZE
public static final java.lang.String TOTAL_SIZE
- See Also:
- Constant Field Values
-
-
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 YYYYMMDDto
- Date range to in form YYYYMMDDdateType
- Type of dateSearch.DATE_TYPE_ACQUISITION
orSearch.DATE_TYPE_IMPORT
query
- The terms to search foranalyzer
-
-
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 theObject
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)
-
-