public class LuceneComplexSearchQuery extends AbstractLuceneSearchQuery implements ComplexSearchQuery
SearchQuery
interface using lucene as
underlying search-engine.Modifier and Type | Field and Description |
---|---|
private org.apache.lucene.search.BooleanQuery |
query
the actual lucene query
|
private int |
size |
Constructor and Description |
---|
LuceneComplexSearchQuery()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addExcludingQuery(SearchQuery subQuery)
This method adds the given
subQuery as excluding sub-query. |
void |
addOptionalQuery(SearchQuery subQuery)
This method adds the given
subQuery as optional sub-query. |
private void |
addQuery(org.apache.lucene.search.BooleanClause.Occur occur,
SearchQuery subQuery)
This method adds the given
subQuery using the given
occur . |
void |
addRequiredQuery(SearchQuery subQuery)
This method adds the given
subQuery as required sub-query. |
org.apache.lucene.search.BooleanQuery |
getLuceneQuery()
This method gets the native lucene query.
|
int |
getSubQueryCount()
This method gets the number of sub-queries that have been added to this query.
|
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toString
private org.apache.lucene.search.BooleanQuery query
private int size
getSubQueryCount()
public org.apache.lucene.search.BooleanQuery getLuceneQuery()
getLuceneQuery
in class AbstractLuceneSearchQuery
private void addQuery(org.apache.lucene.search.BooleanClause.Occur occur, SearchQuery subQuery)
subQuery
using the given
occur
.occur
- is the occur to use.subQuery
- is the sub-query to add.public void addExcludingQuery(SearchQuery subQuery)
subQuery
as excluding sub-query. A
entry
must NOT match the subQuery
in order to
match this complex query.addExcludingQuery
in interface ComplexSearchQuery
subQuery
- is the sub-query to add.public void addOptionalQuery(SearchQuery subQuery)
subQuery
as optional sub-query. A
entry
should match the subQuery
in order to match
this complex query. Else if other sub-queries match, this complex query can still match with a lower
score
.addOptionalQuery
in interface ComplexSearchQuery
subQuery
- is the sub-query to add.public void addRequiredQuery(SearchQuery subQuery)
subQuery
as required sub-query. A
entry
has to match the subQuery
in order to match
this complex query.addRequiredQuery
in interface ComplexSearchQuery
subQuery
- is the sub-query to add.public int getSubQueryCount()
getSubQueryCount
in interface ComplexSearchQuery
Copyright © 2001–2016 mmm-Team. All rights reserved.