Usually, if you have to filter on more than one criteria, you use the AndCriteriaAndCriteria
or OrCriteriaOrCriteria
object. This allows you to combine two or more different criteria.
You can do something like this
TaxonomyKeywordCriteria taxonomyKeywordCriteria1 = new TaxonomyKeywordCriteria(strTaxURI1, strTaxKeywordURI1, false);
TaxonomyKeywordCriteria taxonomyKeywordCriteria2 = new TaxonomyKeywordCriteria(strTaxURI2, strTaxKeywordURI2, false);
AndCriteria andCriteria = new AndCriteria(taxonomyKeywordCriteria1, taxonomyKeywordCriteria2);
myQuery.setCriteria(andCriteria);
//etc...
youYou can also combine andcriteriaAndCriteria
and orcriteriaOrCriteria
objects to make complex queries.
Check the documentation for an overview of all different types of Criteria objects : http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/GUID-AC27E3C1-9E21-4664-A85B-DFAB8CB63632