@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AttributeFilter extends Object implements Serializable, Cloneable, StructuredPojo
Filters the search results based on document attributes or fields.
You can filter results using attributes for your particular documents. The attributes must exist in your index. For
example, if your documents include the custom attribute "Department", you can filter documents that belong to the
"HR" department. You would use the EqualsTo
operation to filter results or documents with "Department"
equals to "HR".
You can use AndAllFilters
and AndOrFilters
in combination with each other or with other
operations such as EqualsTo
. For example:
AndAllFilters
EqualsTo
: "Department", "HR"
AndOrFilters
ContainsAny
: "Project Name", ["new hires", "new hiring"]
This example filters results or documents that belong to the HR department and belong to projects that contain
"new hires" or "new hiring" in the project name (must use ContainAny
with
StringListValue
). This example is filtering with a depth of 2.
You cannot filter more than a depth of 2, otherwise you receive a ValidationException
exception with the
message "AttributeFilter cannot have a depth of more than 2." Also, if you use more than 10 attribute filters in a
given list for AndAllFilters
or OrAllFilters
, you receive a
ValidationException
with the message "AttributeFilter cannot have a length of more than 10".
For examples of using AttributeFilter
, see Using document attributes to
filter search results.
Constructor and Description |
---|
AttributeFilter() |
Modifier and Type | Method and Description |
---|---|
AttributeFilter |
clone() |
boolean |
equals(Object obj) |
List<AttributeFilter> |
getAndAllFilters()
Performs a logical
AND operation on all filters that you specify. |
DocumentAttribute |
getContainsAll()
Returns true when a document contains all of the specified document attributes/fields.
|
DocumentAttribute |
getContainsAny()
Returns true when a document contains any of the specified document attributes/fields.
|
DocumentAttribute |
getEqualsTo()
Performs an equals operation on document attributes/fields and their values.
|
DocumentAttribute |
getGreaterThan()
Performs a greater than operation on document attributes/fields and their values.
|
DocumentAttribute |
getGreaterThanOrEquals()
Performs a greater or equals than operation on document attributes/fields and their values.
|
DocumentAttribute |
getLessThan()
Performs a less than operation on document attributes/fields and their values.
|
DocumentAttribute |
getLessThanOrEquals()
Performs a less than or equals operation on document attributes/fields and their values.
|
AttributeFilter |
getNotFilter()
Performs a logical
NOT operation on all filters that you specify. |
List<AttributeFilter> |
getOrAllFilters()
Performs a logical
OR operation on all filters that you specify. |
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setAndAllFilters(Collection<AttributeFilter> andAllFilters)
Performs a logical
AND operation on all filters that you specify. |
void |
setContainsAll(DocumentAttribute containsAll)
Returns true when a document contains all of the specified document attributes/fields.
|
void |
setContainsAny(DocumentAttribute containsAny)
Returns true when a document contains any of the specified document attributes/fields.
|
void |
setEqualsTo(DocumentAttribute equalsTo)
Performs an equals operation on document attributes/fields and their values.
|
void |
setGreaterThan(DocumentAttribute greaterThan)
Performs a greater than operation on document attributes/fields and their values.
|
void |
setGreaterThanOrEquals(DocumentAttribute greaterThanOrEquals)
Performs a greater or equals than operation on document attributes/fields and their values.
|
void |
setLessThan(DocumentAttribute lessThan)
Performs a less than operation on document attributes/fields and their values.
|
void |
setLessThanOrEquals(DocumentAttribute lessThanOrEquals)
Performs a less than or equals operation on document attributes/fields and their values.
|
void |
setNotFilter(AttributeFilter notFilter)
Performs a logical
NOT operation on all filters that you specify. |
void |
setOrAllFilters(Collection<AttributeFilter> orAllFilters)
Performs a logical
OR operation on all filters that you specify. |
String |
toString()
Returns a string representation of this object.
|
AttributeFilter |
withAndAllFilters(AttributeFilter... andAllFilters)
Performs a logical
AND operation on all filters that you specify. |
AttributeFilter |
withAndAllFilters(Collection<AttributeFilter> andAllFilters)
Performs a logical
AND operation on all filters that you specify. |
AttributeFilter |
withContainsAll(DocumentAttribute containsAll)
Returns true when a document contains all of the specified document attributes/fields.
|
AttributeFilter |
withContainsAny(DocumentAttribute containsAny)
Returns true when a document contains any of the specified document attributes/fields.
|
AttributeFilter |
withEqualsTo(DocumentAttribute equalsTo)
Performs an equals operation on document attributes/fields and their values.
|
AttributeFilter |
withGreaterThan(DocumentAttribute greaterThan)
Performs a greater than operation on document attributes/fields and their values.
|
AttributeFilter |
withGreaterThanOrEquals(DocumentAttribute greaterThanOrEquals)
Performs a greater or equals than operation on document attributes/fields and their values.
|
AttributeFilter |
withLessThan(DocumentAttribute lessThan)
Performs a less than operation on document attributes/fields and their values.
|
AttributeFilter |
withLessThanOrEquals(DocumentAttribute lessThanOrEquals)
Performs a less than or equals operation on document attributes/fields and their values.
|
AttributeFilter |
withNotFilter(AttributeFilter notFilter)
Performs a logical
NOT operation on all filters that you specify. |
AttributeFilter |
withOrAllFilters(AttributeFilter... orAllFilters)
Performs a logical
OR operation on all filters that you specify. |
AttributeFilter |
withOrAllFilters(Collection<AttributeFilter> orAllFilters)
Performs a logical
OR operation on all filters that you specify. |
public List<AttributeFilter> getAndAllFilters()
Performs a logical AND
operation on all filters that you specify.
AND
operation on all filters that you specify.public void setAndAllFilters(Collection<AttributeFilter> andAllFilters)
Performs a logical AND
operation on all filters that you specify.
andAllFilters
- Performs a logical AND
operation on all filters that you specify.public AttributeFilter withAndAllFilters(AttributeFilter... andAllFilters)
Performs a logical AND
operation on all filters that you specify.
NOTE: This method appends the values to the existing list (if any). Use
setAndAllFilters(java.util.Collection)
or withAndAllFilters(java.util.Collection)
if you want
to override the existing values.
andAllFilters
- Performs a logical AND
operation on all filters that you specify.public AttributeFilter withAndAllFilters(Collection<AttributeFilter> andAllFilters)
Performs a logical AND
operation on all filters that you specify.
andAllFilters
- Performs a logical AND
operation on all filters that you specify.public List<AttributeFilter> getOrAllFilters()
Performs a logical OR
operation on all filters that you specify.
OR
operation on all filters that you specify.public void setOrAllFilters(Collection<AttributeFilter> orAllFilters)
Performs a logical OR
operation on all filters that you specify.
orAllFilters
- Performs a logical OR
operation on all filters that you specify.public AttributeFilter withOrAllFilters(AttributeFilter... orAllFilters)
Performs a logical OR
operation on all filters that you specify.
NOTE: This method appends the values to the existing list (if any). Use
setOrAllFilters(java.util.Collection)
or withOrAllFilters(java.util.Collection)
if you want to
override the existing values.
orAllFilters
- Performs a logical OR
operation on all filters that you specify.public AttributeFilter withOrAllFilters(Collection<AttributeFilter> orAllFilters)
Performs a logical OR
operation on all filters that you specify.
orAllFilters
- Performs a logical OR
operation on all filters that you specify.public void setNotFilter(AttributeFilter notFilter)
Performs a logical NOT
operation on all filters that you specify.
notFilter
- Performs a logical NOT
operation on all filters that you specify.public AttributeFilter getNotFilter()
Performs a logical NOT
operation on all filters that you specify.
NOT
operation on all filters that you specify.public AttributeFilter withNotFilter(AttributeFilter notFilter)
Performs a logical NOT
operation on all filters that you specify.
notFilter
- Performs a logical NOT
operation on all filters that you specify.public void setEqualsTo(DocumentAttribute equalsTo)
Performs an equals operation on document attributes/fields and their values.
equalsTo
- Performs an equals operation on document attributes/fields and their values.public DocumentAttribute getEqualsTo()
Performs an equals operation on document attributes/fields and their values.
public AttributeFilter withEqualsTo(DocumentAttribute equalsTo)
Performs an equals operation on document attributes/fields and their values.
equalsTo
- Performs an equals operation on document attributes/fields and their values.public void setContainsAll(DocumentAttribute containsAll)
Returns true when a document contains all of the specified document attributes/fields. This filter is only applicable to StringListValue .
containsAll
- Returns true when a document contains all of the specified document attributes/fields. This filter is only
applicable to StringListValue.public DocumentAttribute getContainsAll()
Returns true when a document contains all of the specified document attributes/fields. This filter is only applicable to StringListValue .
public AttributeFilter withContainsAll(DocumentAttribute containsAll)
Returns true when a document contains all of the specified document attributes/fields. This filter is only applicable to StringListValue .
containsAll
- Returns true when a document contains all of the specified document attributes/fields. This filter is only
applicable to StringListValue.public void setContainsAny(DocumentAttribute containsAny)
Returns true when a document contains any of the specified document attributes/fields. This filter is only applicable to StringListValue .
containsAny
- Returns true when a document contains any of the specified document attributes/fields. This filter is only
applicable to StringListValue.public DocumentAttribute getContainsAny()
Returns true when a document contains any of the specified document attributes/fields. This filter is only applicable to StringListValue .
public AttributeFilter withContainsAny(DocumentAttribute containsAny)
Returns true when a document contains any of the specified document attributes/fields. This filter is only applicable to StringListValue .
containsAny
- Returns true when a document contains any of the specified document attributes/fields. This filter is only
applicable to StringListValue.public void setGreaterThan(DocumentAttribute greaterThan)
Performs a greater than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
greaterThan
- Performs a greater than operation on document attributes/fields and their values. Use with the document
attribute type Date
or Long
.public DocumentAttribute getGreaterThan()
Performs a greater than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
Date
or Long
.public AttributeFilter withGreaterThan(DocumentAttribute greaterThan)
Performs a greater than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
greaterThan
- Performs a greater than operation on document attributes/fields and their values. Use with the document
attribute type Date
or Long
.public void setGreaterThanOrEquals(DocumentAttribute greaterThanOrEquals)
Performs a greater or equals than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
greaterThanOrEquals
- Performs a greater or equals than operation on document attributes/fields and their values. Use with the
document
attribute type Date
or Long
.public DocumentAttribute getGreaterThanOrEquals()
Performs a greater or equals than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
Date
or Long
.public AttributeFilter withGreaterThanOrEquals(DocumentAttribute greaterThanOrEquals)
Performs a greater or equals than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
greaterThanOrEquals
- Performs a greater or equals than operation on document attributes/fields and their values. Use with the
document
attribute type Date
or Long
.public void setLessThan(DocumentAttribute lessThan)
Performs a less than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
lessThan
- Performs a less than operation on document attributes/fields and their values. Use with the document
attribute type Date
or Long
.public DocumentAttribute getLessThan()
Performs a less than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
Date
or Long
.public AttributeFilter withLessThan(DocumentAttribute lessThan)
Performs a less than operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
lessThan
- Performs a less than operation on document attributes/fields and their values. Use with the document
attribute type Date
or Long
.public void setLessThanOrEquals(DocumentAttribute lessThanOrEquals)
Performs a less than or equals operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
lessThanOrEquals
- Performs a less than or equals operation on document attributes/fields and their values. Use with the document
attribute type Date
or Long
.public DocumentAttribute getLessThanOrEquals()
Performs a less than or equals operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
Date
or Long
.public AttributeFilter withLessThanOrEquals(DocumentAttribute lessThanOrEquals)
Performs a less than or equals operation on document attributes/fields and their values. Use with the document attribute
type Date
or Long
.
lessThanOrEquals
- Performs a less than or equals operation on document attributes/fields and their values. Use with the document
attribute type Date
or Long
.public String toString()
toString
in class Object
Object.toString()
public AttributeFilter clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.