public class Criteria extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Criteria.CriteriaEntry |
static class |
Criteria.OperationKey |
Modifier and Type | Field and Description |
---|---|
static String |
CRITERIA_VALUE_SEPERATOR |
static String |
WILDCARD |
Modifier | Constructor and Description |
---|---|
|
Criteria() |
|
Criteria(Field field)
Creates a new Criteria for the given field
|
protected |
Criteria(List<Criteria> criteriaChain,
Field field) |
protected |
Criteria(List<Criteria> criteriaChain,
String fieldname) |
|
Criteria(String fieldname)
Creates a new Criteria for the Filed with provided name
|
Modifier and Type | Method and Description |
---|---|
Criteria |
and(Criteria... criterias)
Chain using
AND |
Criteria |
and(Criteria criteria)
Chain using
AND |
Criteria |
and(Field field)
Chain using
AND |
Criteria |
and(String fieldname)
Chain using
AND |
Criteria |
between(Object lowerBound,
Object upperBound)
Crates new CriteriaEntry for
RANGE [lowerBound TO upperBound] |
Criteria |
between(Object lowerBound,
Object upperBound,
boolean includeLowerBound,
boolean includeUppderBound)
Crates new CriteriaEntry for
RANGE [lowerBound TO upperBound] |
Criteria |
boost(float boost)
Boost positive hit with given factor. eg. ^2.3
|
Criteria |
contains(String s)
Crates new CriteriaEntry with leading and trailing wildcards
NOTE: mind your schema as leading wildcards may not be supported and/or execution might be slow. |
Criteria |
endsWith(String s)
Crates new CriteriaEntry with leading wildcard
NOTE: mind your schema and execution times as leading wildcards may not be supported. |
Criteria |
expression(String s)
Crates new CriteriaEntry allowing native solr expressions
|
Criteria |
fuzzy(String s)
Crates new CriteriaEntry with trailing ~
|
Criteria |
fuzzy(String s,
float levenshteinDistance)
Crates new CriteriaEntry with trailing ~ followed by levensteinDistance
|
float |
getBoost()
Boost criteria value
|
String |
getConjunctionOperator()
Conjunction to be used with this criteria (AND | OR)
|
List<Criteria> |
getCriteriaChain()
Get the collection of criterias
|
Set<Criteria.CriteriaEntry> |
getCriteriaEntries() |
Field |
getField()
Field targeted by this Criteria
|
Criteria |
greaterThan(Object lowerBound)
Crates new CriteriaEntry for
RANGE {lowerBound TO *] |
Criteria |
greaterThanEqual(Object lowerBound)
Crates new CriteriaEntry for
RANGE [lowerBound TO *] |
Criteria |
in(Iterable<?> values)
Crates new CriteriaEntry for multiple values
(arg0 arg1 arg2 ...) |
Criteria |
in(Object... values)
Crates new CriteriaEntry for multiple values
(arg0 arg1 arg2 ...) |
Criteria |
is(Object o)
Crates new CriteriaEntry without any wildcards
|
boolean |
isNegating() |
Criteria |
lessThan(Object upperBound)
Crates new CriteriaEntry for
RANGE [* TO upperBound} |
Criteria |
lessThanEqual(Object upperBound)
Crates new CriteriaEntry for
RANGE [* TO upperBound] |
Criteria |
near(BoundingBox box)
Creates new CriteriaEntriy for {@code !
|
Criteria |
near(GeoLocation location,
Distance distance)
Creates new CriteriaEntry for {@code !
|
Criteria |
not()
Crates new CriteriaEntry with leading -
|
Criteria |
or(Criteria criteria)
Chain using
OR |
Criteria |
or(Field field)
Chain using
OR |
Criteria |
or(String fieldname)
Chain using
OR |
Criteria |
startsWith(String s)
Crates new CriteriaEntry with trailing wildcard
|
static Criteria |
where(Field field)
Static factory method to create a new Criteria for provided field
|
static Criteria |
where(String field)
Static factory method to create a new Criteria for field with given name
|
Criteria |
within(GeoLocation location,
Distance distance)
Creates new CriteriaEntry for {@code !
|
public static final String WILDCARD
public static final String CRITERIA_VALUE_SEPERATOR
public Criteria()
public Criteria(String fieldname)
fieldname
- public Criteria(Field field)
field
- public static Criteria where(String field)
field
- public static Criteria where(Field field)
field
- public Criteria is(Object o)
o
- public Criteria contains(String s)
o
- public Criteria startsWith(String s)
o
- public Criteria endsWith(String s)
o
- public Criteria not()
s
- public Criteria fuzzy(String s)
s
- public Criteria fuzzy(String s, float levenshteinDistance)
s
- levenshteinDistance
- public Criteria expression(String s)
o
- public Criteria boost(float boost)
boost
- public Criteria between(Object lowerBound, Object upperBound)
RANGE [lowerBound TO upperBound]
lowerBound
- upperBound
- public Criteria between(Object lowerBound, Object upperBound, boolean includeLowerBound, boolean includeUppderBound)
RANGE [lowerBound TO upperBound]
lowerBound
- upperBound
- includeLowerBound
- includeUppderBound
- public Criteria lessThan(Object upperBound)
RANGE [* TO upperBound}
upperBound
- public Criteria lessThanEqual(Object upperBound)
RANGE [* TO upperBound]
upperBound
- public Criteria greaterThan(Object lowerBound)
RANGE {lowerBound TO *]
lowerBound
- public Criteria greaterThanEqual(Object lowerBound)
RANGE [lowerBound TO *]
lowerBound
- public Criteria in(Object... values)
(arg0 arg1 arg2 ...)
lowerBound
- public Criteria in(Iterable<?> values)
(arg0 arg1 arg2 ...)
c
- the collection containing the values to match againstpublic Criteria within(GeoLocation location, Distance distance)
!geodist
location
- Geolocation in degreesdistance
- public Criteria near(BoundingBox box)
!bbox
with exact coordinatesbox
- public Criteria near(GeoLocation location, Distance distance)
!bbox
for a specified distance. The difference between this and
within
is this is approximate while within
is exact.location
- distance
- public Field getField()
public Set<Criteria.CriteriaEntry> getCriteriaEntries()
public String getConjunctionOperator()
public boolean isNegating()
not()
criteriapublic float getBoost()
Float.NaN
if not setCopyright © 2011-2013-2013 SpringSource. All Rights Reserved.