Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove std attribute specifics while faceting
  • Loading branch information
anithakathir committed Feb 27, 2017
commit fb35aca0580a4933ba8df08d155eec5c0ed41e07
3 changes: 1 addition & 2 deletions src/main/java/com/indix/query/SearchQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public SearchQuery withCategoryId(List<Integer> categoryId) {
/**
* Combined with any of query/brand/category/store, limits results to products with specific attribute values
* NOTE:
* Prepends attribute filter key with "attr.", since product attributes are identified that way.
* Examples of a few product attribute keys and values are:
* 1. color -> red / blue / green / black
* 2. size -> xs / s / m / l / xl
Expand Down Expand Up @@ -237,7 +236,7 @@ public SearchQuery withFacetBy(List<String> facetBy) {
*/
public SearchQuery withAttrFacetBy(List<String> attrFacetBy) {
for (String attrFacet : attrFacetBy) {
parameters.add(new BasicNameValuePair("attrFacetBy", attrFacet));
parameters.add(new BasicNameValuePair("attrFacetBy", "attr."+attrFacet));
}
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/indix/query/SearchQueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testBasicQuery() {
.withSku("sku1")
.withSortBy(SearchQuery.SortBy.PRICE_HIGH_TO_LOW)
.withFacetBy(Arrays.asList("storeId", "brandId"))
.withAttrFacetBy(Arrays.asList("attr.color", "attr.size"))
.withAttrFacetBy(Arrays.asList("color", "size"))
.withAttrFilter("color", Arrays.asList("black", "red"))
.withAttrFilter("size", Arrays.asList("xs"))
.withPageNumber(5)
Expand Down