com.mysema.query.lucene
Class LuceneQuery

java.lang.Object
  extended by com.mysema.query.lucene.LuceneQuery
All Implemented Interfaces:
SimpleProjectable<org.apache.lucene.document.Document>, SimpleQuery<LuceneQuery>

public class LuceneQuery
extends Object
implements SimpleQuery<LuceneQuery>, SimpleProjectable<org.apache.lucene.document.Document>

LuceneQuery is a Querydsl query implementation for Lucene queries.

Author:
vema

Constructor Summary
LuceneQuery(LuceneSerializer serializer, org.apache.lucene.search.Searcher searcher)
           
LuceneQuery(org.apache.lucene.search.Searcher searcher)
           
 
Method Summary
 long count()
          Get the count of matched elements
 long countDistinct()
          Get the count of distinct matched elements
 LuceneQuery limit(long limit)
          Defines the limit / max results for the query results
 List<org.apache.lucene.document.Document> list()
          Get the projection as a typed List
 List<org.apache.lucene.document.Document> listDistinct()
          Get the projection as a typed List with distinct elements
 SearchResults<org.apache.lucene.document.Document> listDistinctResults()
          Get the projection in SearchResults form with distinct element
 SearchResults<org.apache.lucene.document.Document> listResults()
          Get the projection in SearchResults form
 LuceneQuery offset(long offset)
          Defines the offset for the query results
 LuceneQuery orderBy(OrderSpecifier<?>... o)
          Defines the order expressions
 LuceneQuery restrict(QueryModifiers modifiers)
          Defines both limit and offset of the query results
 org.apache.lucene.document.Document uniqueResult()
          Get the projection as a unique result
 LuceneQuery where(EBoolean... e)
          Defines the filter constraints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneQuery

public LuceneQuery(org.apache.lucene.search.Searcher searcher)
Parameters:
lowerCase -
searcher -

LuceneQuery

public LuceneQuery(LuceneSerializer serializer,
                   org.apache.lucene.search.Searcher searcher)
Parameters:
serializer -
searcher -
Method Detail

limit

public LuceneQuery limit(long limit)
Description copied from interface: SimpleQuery
Defines the limit / max results for the query results

Specified by:
limit in interface SimpleQuery<LuceneQuery>
Returns:

offset

public LuceneQuery offset(long offset)
Description copied from interface: SimpleQuery
Defines the offset for the query results

Specified by:
offset in interface SimpleQuery<LuceneQuery>
Returns:

orderBy

public LuceneQuery orderBy(OrderSpecifier<?>... o)
Description copied from interface: SimpleQuery
Defines the order expressions

Specified by:
orderBy in interface SimpleQuery<LuceneQuery>
Returns:

restrict

public LuceneQuery restrict(QueryModifiers modifiers)
Description copied from interface: SimpleQuery
Defines both limit and offset of the query results

Specified by:
restrict in interface SimpleQuery<LuceneQuery>
Returns:

where

public LuceneQuery where(EBoolean... e)
Description copied from interface: SimpleQuery
Defines the filter constraints

Specified by:
where in interface SimpleQuery<LuceneQuery>
Returns:

count

public long count()
Description copied from interface: SimpleProjectable
Get the count of matched elements

Specified by:
count in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:

countDistinct

public long countDistinct()
Description copied from interface: SimpleProjectable
Get the count of distinct matched elements

Specified by:
countDistinct in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:

list

public List<org.apache.lucene.document.Document> list()
Description copied from interface: SimpleProjectable
Get the projection as a typed List

Specified by:
list in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:

listDistinct

public List<org.apache.lucene.document.Document> listDistinct()
Description copied from interface: SimpleProjectable
Get the projection as a typed List with distinct elements

Specified by:
listDistinct in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:

listDistinctResults

public SearchResults<org.apache.lucene.document.Document> listDistinctResults()
Description copied from interface: SimpleProjectable
Get the projection in SearchResults form with distinct element

Specified by:
listDistinctResults in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:

listResults

public SearchResults<org.apache.lucene.document.Document> listResults()
Description copied from interface: SimpleProjectable
Get the projection in SearchResults form

Specified by:
listResults in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:

uniqueResult

public org.apache.lucene.document.Document uniqueResult()
Description copied from interface: SimpleProjectable
Get the projection as a unique result

Specified by:
uniqueResult in interface SimpleProjectable<org.apache.lucene.document.Document>
Returns:


Copyright © 2007-2010 Mysema Ltd. All Rights Reserved.