Subversion Repositories SmartDukaan

Rev

Rev 1306 | Rev 1377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1306 Rev 1376
Line 36... Line 36...
36
	
36
	
37
	private static final long serialVersionUID = 8477108528765030321L;
37
	private static final long serialVersionUID = 8477108528765030321L;
38
 
38
 
39
	private static Logger log = Logger.getLogger(Class.class);
39
	private static Logger log = Logger.getLogger(Class.class);
40
 
40
 
-
 
41
	private static long ROOT_CATEGORY = 10000;
-
 
42
	private static long MOBILE_PHONES_CATEGORY = 10001;
-
 
43
	private static long MOBILE_ACCESSORIES_CATEGORY = 10011;
-
 
44
	
41
	private List<String> results;
45
	private List<String> results;
42
	private Map<String, String> snippets;
46
	private Map<String, String> snippets;
43
	private Map<String, List<String[]>> facets;
47
	private Map<String, List<String[]>> facets;
44
	private List<String[]> crumbs;
48
	private List<String[]> crumbs;
45
	/**
49
	/**
Line 111... Line 115...
111
    		length += fqrys.length;
115
    		length += fqrys.length;
112
    	}
116
    	}
113
    	
117
    	
114
    	
118
    	
115
    	String[] newfqrys = new String[length];
119
    	String[] newfqrys = new String[length];
116
    	if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId() == 10000){
120
    	if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId() == ROOT_CATEGORY){
117
    		newfqrys[0] = "F_50010:"+categoryName;
121
    		newfqrys[0] = "F_50010:"+categoryName;
118
    	}else{
122
    	}else{
119
    		newfqrys[0] = "F_50011:"+categoryName;
123
    		newfqrys[0] = "F_50011:"+categoryName;
120
    	}
124
    	}
121
    	
125
    	
Line 157... Line 161...
157
    	if(this.request.getParameter("max-price") != null){
161
    	if(this.request.getParameter("max-price") != null){
158
    		this.maxPrice = (new Double(this.request.getParameter("max-price")));
162
    		this.maxPrice = (new Double(this.request.getParameter("max-price")));
159
    		url= url + "&max-price=" + this.request.getParameter("max-price");
163
    		url= url + "&max-price=" + this.request.getParameter("max-price");
160
    	}    	
164
    	}    	
161
    	
165
    	
162
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, 10000, null);
166
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, ROOT_CATEGORY, null);
163
    	this.results =  search.getResultMap(); 
167
    	this.results =  search.getResultMap(); 
164
 
168
 
165
    	
169
    	
166
    	this.facets = new LinkedHashMap<String, List<String[]>>();
170
    	this.facets = new LinkedHashMap<String, List<String[]>>();
167
    	String qryString = this.request.getQueryString();
171
    	String qryString = this.request.getQueryString();
Line 230... Line 234...
230
    	return "Best price " + this.facetSelection + this.categoryName.replaceAll("Phones", "mobile phones") 
234
    	return "Best price " + this.facetSelection + this.categoryName.replaceAll("Phones", "mobile phones") 
231
    	    + " in India. Experience n' buy online. FREE Next Day delivery. Original product - Full manufacturer warranty. Comprehensive reviews."; 
235
    	    + " in India. Experience n' buy online. FREE Next Day delivery. Original product - Full manufacturer warranty. Comprehensive reviews."; 
232
    }
236
    }
233
    
237
    
234
    public String getPageMetaKeywords() {
238
    public String getPageMetaKeywords() {
235
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId()== 10001){
239
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId()== MOBILE_PHONES_CATEGORY){
236
        	return this.categoryName + ", mobile phone";
240
        	return this.categoryName + ", mobile phone";
237
    	}
241
    	}
238
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId()== 10011){
242
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId()== MOBILE_ACCESSORIES_CATEGORY){
239
        	return this.categoryName + ", phone accessories";
243
        	return this.categoryName + ", phone accessories";
240
    	}
244
    	}
241
        return "";
245
        return "";
242
    }
246
    }
243
    
247
    
Line 275... Line 279...
275
			return beginIndex+1;
279
			return beginIndex+1;
276
		return beginIndex;
280
		return beginIndex;
277
	}
281
	}
278
 
282
 
279
	public long getTotalPages() {
283
	public long getTotalPages() {
280
		return 1 + totalResults/windowSize;
284
		return 1 + (totalResults-1)/windowSize;
281
	}
285
	}
282
 
286
 
283
	public long getCurrentPage() {
287
	public long getCurrentPage() {
284
		return this.page;
288
		return this.page;
285
	}
289
	}