File tree Expand file tree Collapse file tree
main/java/com/indix/query
test/java/com/indix/query Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,10 +56,18 @@ public SearchQuery withCategoryId(List<Integer> categoryId) {
5656
5757 /**
5858 * Combined with any of query/brand/category/store, limits results to products with specific attribute values
59+ * NOTE:
60+ * Prepends attribute filter key with "attr.", since product attributes are identified that way.
61+ * Examples of a few product attribute keys and values are:
62+ * 1. color -> red / blue / green / black
63+ * 2. size -> xs / s / m / l / xl
64+ * 3. gender -> mens / womens
65+ * A schema for the filterable keys and values isn't in place yet.
66+ * When the standard schema is published, the filterable keys for a category and the list of values for the same will be available.
5967 */
6068 public SearchQuery withAttrFilter (String attrFilterKey , List <String > attrFilterValues ) {
6169 for (String attrValue : attrFilterValues ) {
62- parameters .add (new BasicNameValuePair (attrFilterKey , attrValue ));
70+ parameters .add (new BasicNameValuePair ("attr." + attrFilterKey , attrValue ));
6371 }
6472 return this ;
6573 }
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ public void testBasicQuery() {
5858 .withSortBy (SearchQuery .SortBy .PRICE_HIGH_TO_LOW )
5959 .withFacetBy (Arrays .asList ("storeId" , "brandId" ))
6060 .withAttrFacetBy (Arrays .asList ("attr.color" , "attr.size" ))
61- .withAttrFilter ("attr. color" , Arrays .asList ("black" , "red" ))
62- .withAttrFilter ("attr. size" , Arrays .asList ("xs" ))
61+ .withAttrFilter ("color" , Arrays .asList ("black" , "red" ))
62+ .withAttrFilter ("size" , Arrays .asList ("xs" ))
6363 .withPageNumber (5 )
6464 .withPageSize (55 )
6565 .withCountryCode ("US" )
You can’t perform that action at this time.
0 commit comments