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 @@ -224,6 +224,16 @@ public SearchQuery withFacetBy(List<String> facetBy) {
224224 return this ;
225225 }
226226
227+ /**
228+ * Facet by product attribute values
229+ */
230+ public SearchQuery withAttrFacetBy (List <String > attrFacetBy ) {
231+ for (String attrFacet : attrFacetBy ) {
232+ parameters .add (new BasicNameValuePair ("attrFacetBy" , attrFacet ));
233+ }
234+ return this ;
235+ }
236+
227237 /**
228238 * Specifies the page number of the result set to return. 10 results per page.
229239 */
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ public void testBasicQuery() {
4141 expectedValue .add (new BasicNameValuePair ("sortBy" , "PRICE_HIGH_TO_LOW" ));
4242 expectedValue .add (new BasicNameValuePair ("facetBy" , "storeId" ));
4343 expectedValue .add (new BasicNameValuePair ("facetBy" , "brandId" ));
44+ expectedValue .add (new BasicNameValuePair ("attrFacetBy" , "attr.color" ));
45+ expectedValue .add (new BasicNameValuePair ("attrFacetBy" , "attr.size" ));
4446 expectedValue .add (new BasicNameValuePair ("attr.color" , "black" ));
4547 expectedValue .add (new BasicNameValuePair ("attr.color" , "red" ));
4648 expectedValue .add (new BasicNameValuePair ("attr.size" , "xs" ));
@@ -55,6 +57,7 @@ public void testBasicQuery() {
5557 .withSku ("sku1" )
5658 .withSortBy (SearchQuery .SortBy .PRICE_HIGH_TO_LOW )
5759 .withFacetBy (Arrays .asList ("storeId" , "brandId" ))
60+ .withAttrFacetBy (Arrays .asList ("attr.color" , "attr.size" ))
5861 .withAttrFilter ("attr.color" , Arrays .asList ("black" , "red" ))
5962 .withAttrFilter ("attr.size" , Arrays .asList ("xs" ))
6063 .withPageNumber (5 )
You can’t perform that action at this time.
0 commit comments