| Line 60... |
Line 60... |
| 60 |
/**
|
60 |
/**
|
| 61 |
*
|
61 |
*
|
| 62 |
* @param query
|
62 |
* @param query
|
| 63 |
* @param facetDefinitionIDs
|
63 |
* @param facetDefinitionIDs
|
| 64 |
*/
|
64 |
*/
|
| 65 |
public SolrSearchService(String query, String[] facetqueries, String[] facetDefinitionIDs, long start, long rows, Double minPrice, Double maxPrice) {
|
65 |
public SolrSearchService(String query, String[] facetqueries, String[] facetDefinitionIDs, long start, long rows, Double minPrice, Double maxPrice, long categoryId, String sortOrder) {
|
| 66 |
|
66 |
|
| 67 |
this.xpath = XPathFactory.newInstance().newXPath();
|
67 |
this.xpath = XPathFactory.newInstance().newXPath();
|
| 68 |
|
68 |
|
| 69 |
// if multiple words are given, it should do AND for all of them
|
69 |
// if multiple words are given, it should do AND for all of them
|
| 70 |
if(query.contains(" ")){
|
70 |
if(query.contains(" ")){
|
| Line 91... |
Line 91... |
| 91 |
maxString = maxPrice.toString();
|
91 |
maxString = maxPrice.toString();
|
| 92 |
}
|
92 |
}
|
| 93 |
uri += "&fq=F_50002:["+ minString + " " + maxString + "]";
|
93 |
uri += "&fq=F_50002:["+ minString + " " + maxString + "]";
|
| 94 |
}
|
94 |
}
|
| 95 |
|
95 |
|
| - |
|
96 |
if(categoryId != 10000){
|
| - |
|
97 |
uri += "&fq=F_50010:\"" + CategoryManager.getCategoryManager().getCategoryLabel(categoryId) + "\"";
|
| 96 |
|
98 |
}
|
| 97 |
|
99 |
|
| - |
|
100 |
if(sortOrder != null){
|
| - |
|
101 |
uri += "&sort=" + sortOrder;
|
| - |
|
102 |
}
|
| 98 |
|
103 |
|
| 99 |
if(facetqueries != null) {
|
104 |
if(facetqueries != null) {
|
| 100 |
for(int i=0; i<facetqueries.length; i++) {
|
105 |
for(int i=0; i<facetqueries.length; i++) {
|
| 101 |
if(facetqueries[i].contains(" ") && !facetqueries[i].contains("F_50002")){
|
106 |
if(facetqueries[i].contains(" ") && !facetqueries[i].contains("F_50002")){
|
| 102 |
String[] tokens = facetqueries[i].split(":");
|
107 |
String[] tokens = facetqueries[i].split(":");
|
| Line 518... |
Line 523... |
| 518 |
String[] facetDefIDs = new String[] {"Category","F_50002","F_50001", "F_50006", "F_50007" };
|
523 |
String[] facetDefIDs = new String[] {"Category","F_50002","F_50001", "F_50006", "F_50007" };
|
| 519 |
String[] facetLabels = new String[] {"Category","Price", "Brand", "Data Connectivity", "Camera Resolution" };
|
524 |
String[] facetLabels = new String[] {"Category","Price", "Brand", "Data Connectivity", "Camera Resolution" };
|
| 520 |
|
525 |
|
| 521 |
|
526 |
|
| 522 |
String[] fqrys = {};
|
527 |
String[] fqrys = {};
|
| 523 |
SolrSearchService search = new SolrSearchService("nokia", fqrys, facetDefIDs, 0 , 20, null, null);
|
528 |
SolrSearchService search = new SolrSearchService("nokia", fqrys, facetDefIDs, 0 , 20, null, null, 10000, null);
|
| 524 |
|
529 |
|
| 525 |
long[] entityIDs = search.getResultEntityIDs();
|
530 |
long[] entityIDs = search.getResultEntityIDs();
|
| 526 |
log.info("entityIDs=" + Arrays.toString(entityIDs));
|
531 |
log.info("entityIDs=" + Arrays.toString(entityIDs));
|
| 527 |
|
532 |
|
| 528 |
String[] entityNames = search.getResultEntityNames();
|
533 |
String[] entityNames = search.getResultEntityNames();
|