| Line 101... |
Line 101... |
| 101 |
}
|
101 |
}
|
| 102 |
|
102 |
|
| 103 |
// This method is the used to pull docs based on search and shall be used
|
103 |
// This method is the used to pull docs based on search and shall be used
|
| 104 |
// interchangably for both the things
|
104 |
// interchangably for both the things
|
| 105 |
public JSONArray getSolrDocs(String queryTerm, String categoryId, int offset, int limit, String sort,
|
105 |
public JSONArray getSolrDocs(String queryTerm, String categoryId, int offset, int limit, String sort,
|
| 106 |
String brand, int subCategoryId, boolean hotDeal, boolean group) throws Throwable {
|
106 |
String brand, int subCategoryId, boolean hotDeal, boolean group, boolean eol_filter) throws Throwable {
|
| 107 |
List<String> parentFilter = new ArrayList<>();
|
107 |
List<String> parentFilter = new ArrayList<>();
|
| 108 |
parentFilter.add("categoryId_i:" + categoryId);
|
108 |
parentFilter.add("categoryId_i:" + categoryId);
|
| 109 |
parentFilter.add("show_default_b:true");
|
109 |
parentFilter.add("show_default_b:true");
|
| 110 |
List<String> childFilter = new ArrayList<>();
|
110 |
List<String> childFilter = new ArrayList<>();
|
| 111 |
childFilter.add("itemId_i:*");
|
111 |
childFilter.add("itemId_i:*");
|
| Line 122... |
Line 122... |
| 122 |
childFilter.add("active_b:true");
|
122 |
childFilter.add("active_b:true");
|
| 123 |
}
|
123 |
}
|
| 124 |
if (subCategoryId != 0) {
|
124 |
if (subCategoryId != 0) {
|
| 125 |
parentFilter.add("subCategoryId_i:" + subCategoryId);
|
125 |
parentFilter.add("subCategoryId_i:" + subCategoryId);
|
| 126 |
}
|
126 |
}
|
| - |
|
127 |
|
| - |
|
128 |
if(eol_filter){
|
| - |
|
129 |
parentFilter.add("eol_no_stock_b:false");
|
| - |
|
130 |
}
|
| 127 |
if (StringUtils.isNotBlank(brand)) {
|
131 |
if (StringUtils.isNotBlank(brand)) {
|
| 128 |
parentFilter.add("brand_ss:" + "\\\"" + brand + "\\\"");
|
132 |
parentFilter.add("brand_ss:" + "\\\"" + brand + "\\\"");
|
| 129 |
}
|
133 |
}
|
| 130 |
if (queryTerm == "") {
|
134 |
if (queryTerm == "") {
|
| 131 |
params.put("sort", (sort == "" ? "" : sort + ", ") + "create_s desc");
|
135 |
params.put("sort", (sort == "" ? "" : sort + ", ") + "create_s desc");
|