Query by Tag
Here we show how to query all of the documents with a certain tag.
This example shows how to query all the documents with the tag "Featured" by using the at predicate.
Copy
Response response = api.query(
Predicates.at("document.tags", Arrays.asList("Featured"))
).submit();
List<Document> documents = response.getResults();
The following example shows how to query all of the documents with either the tag "Tag 1" or "Tag 2" by using the any predicate.
Copy
Response response = api.query(
Predicates.any("document.tags", Arrays.asList("Tag 1", "Tag 2"))
).submit();
List<Document> documents = response.getResults();