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 with provided field 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 |
boost(float boost)
Boost positive hit with given factor. eg. ^2.3
|
Criteria |
boundedBy(org.springframework.data.geo.Box boundingBox)
Creates new CriteriaEntry for
location Box bounding box |
Criteria |
boundedBy(GeoBox boundingBox)
Creates new CriteriaEntry for
location GeoBox bounding box |
Criteria |
boundedBy(GeoPoint topLeftPoint,
GeoPoint bottomRightPoint)
Creates new CriteriaEntry for bounding box created from points
|
Criteria |
boundedBy(org.springframework.data.geo.Point topLeftPoint,
org.springframework.data.geo.Point bottomRightPoint) |
Criteria |
boundedBy(String topLeftGeohash,
String bottomRightGeohash)
Creates new CriteriaEntry for bounding box created from points
|
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 elasticsearch expressions
|
Criteria |
fuzzy(String s)
Crates new CriteriaEntry with trailing ~
|
float |
getBoost() |
String |
getConjunctionOperator()
Conjunction to be used with this criteria (AND | OR)
|
List<Criteria> |
getCriteriaChain() |
Field |
getField()
Field targeted by this Criteria
|
Set<Criteria.CriteriaEntry> |
getFilterCriteria() |
Set<Criteria.CriteriaEntry> |
getFilterCriteriaEntries() |
Set<Criteria.CriteriaEntry> |
getQueryCriteriaEntries() |
Criteria |
greaterThan(Object lowerBound) |
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 |
isAnd() |
boolean |
isNegating() |
boolean |
isOr() |
Criteria |
lessThan(Object upperBound) |
Criteria |
lessThanEqual(Object upperBound)
Crates new CriteriaEntry for
RANGE [* TO upperBound] |
Criteria |
not()
Crates new CriteriaEntry with trailing -
|
Criteria |
notIn(Iterable<?> values) |
Criteria |
notIn(Object... values) |
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
|
String |
toString() |
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(GeoPoint location,
String distance)
Creates new CriteriaEntry for
location WITHIN distance |
Criteria |
within(org.springframework.data.geo.Point location,
org.springframework.data.geo.Distance distance)
Creates new CriteriaEntry for
location WITHIN distance |
Criteria |
within(String geoLocation,
String distance)
Creates new CriteriaEntry for
geoLocation WITHIN distance |
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)
s
- public Criteria startsWith(String s)
s
- public Criteria endsWith(String s)
s
- public Criteria not()
public Criteria fuzzy(String s)
s
- public Criteria expression(String s)
s
- public Criteria boost(float boost)
boost
- public Criteria between(Object lowerBound, Object upperBound)
RANGE [lowerBound TO upperBound]
lowerBound
- upperBound
- public Criteria lessThanEqual(Object upperBound)
RANGE [* TO upperBound]
upperBound
- public Criteria greaterThanEqual(Object lowerBound)
RANGE [lowerBound TO *]
lowerBound
- public Criteria in(Object... values)
(arg0 arg1 arg2 ...)
values
- public Criteria in(Iterable<?> values)
(arg0 arg1 arg2 ...)
values
- the collection containing the values to match againstpublic Criteria within(GeoPoint location, String distance)
location WITHIN distance
public Criteria within(org.springframework.data.geo.Point location, org.springframework.data.geo.Distance distance)
location WITHIN distance
location
- Point
center coordinatesdistance
- Distance
radius
.public Criteria within(String geoLocation, String distance)
geoLocation WITHIN distance
public Criteria boundedBy(GeoBox boundingBox)
location GeoBox bounding box
boundingBox
- GeoBox
bounding box(left top corner + right bottom corner)public Criteria boundedBy(org.springframework.data.geo.Box boundingBox)
location Box bounding box
boundingBox
- GeoBox
bounding box(left top corner + right bottom corner)public Criteria boundedBy(String topLeftGeohash, String bottomRightGeohash)
topLeftGeohash
- left top corner of bounding box as geohashbottomRightGeohash
- right bottom corner of bounding box as geohashpublic Criteria boundedBy(GeoPoint topLeftPoint, GeoPoint bottomRightPoint)
topLeftPoint
- left top corner of bounding boxbottomRightPoint
- right bottom corner of bounding boxpublic Criteria boundedBy(org.springframework.data.geo.Point topLeftPoint, org.springframework.data.geo.Point bottomRightPoint)
public Field getField()
public Set<Criteria.CriteriaEntry> getQueryCriteriaEntries()
public Set<Criteria.CriteriaEntry> getFilterCriteriaEntries()
public Set<Criteria.CriteriaEntry> getFilterCriteria()
public String getConjunctionOperator()
public boolean isNegating()
public boolean isAnd()
public boolean isOr()
public float getBoost()
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.