Subversion Repositories SmartDukaan

Rev

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

Rev 3242 Rev 3561
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.serving.controllers;
4
package in.shop2020.serving.controllers;
5
 
5
 
-
 
6
import in.shop2020.serving.cache.EhcacheWrapper.CacheKeys;
6
import in.shop2020.serving.cache.CategorySnippetCacheWrapper;
7
import in.shop2020.serving.cache.SnippetCacheWrapper;
7
import in.shop2020.serving.services.SolrSearchService;
8
import in.shop2020.serving.services.SolrSearchService;
8
import in.shop2020.serving.utils.Utils;
9
import in.shop2020.serving.utils.Utils;
9
import in.shop2020.utils.CategoryManager;
10
import in.shop2020.utils.CategoryManager;
10
 
11
 
11
import java.io.IOException;
12
import java.io.IOException;
Line 174... Line 175...
174
    	if(this.request.getParameter("maxPrice") != null){
175
    	if(this.request.getParameter("maxPrice") != null){
175
    		this.maxPrice = (new Double(this.request.getParameter("maxPrice")));
176
    		this.maxPrice = (new Double(this.request.getParameter("maxPrice")));
176
    		url= url + "&maxPrice=" + this.request.getParameter("maxPrice");
177
    		url= url + "&maxPrice=" + this.request.getParameter("maxPrice");
177
    	}    	
178
    	}    	
178
 
179
 
179
    	query = query + "&sort=F_50002+asc";
180
    	String sortOrder = "F_50002+asc";
180
    	
181
    	
181
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, Utils.ROOT_CATEGORY, null);
182
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, Utils.ROOT_CATEGORY, sortOrder, sourceId);
182
    	this.results =  search.getResultMap(); 
183
    	this.results =  search.getResultMap(); 
183
 
184
 
184
    	
185
    	
185
    	this.facets = new LinkedHashMap<String, List<String[]>>();
186
    	this.facets = new LinkedHashMap<String, List<String[]>>();
186
    	String qryString = this.request.getQueryString();
187
    	String qryString = this.request.getQueryString();
Line 311... Line 312...
311
 
312
 
312
    public Map<String, String> getSnippets(){
313
    public Map<String, String> getSnippets(){
313
        if(results != null){
314
        if(results != null){
314
    		snippets = new HashMap<String, String>();	
315
    		snippets = new HashMap<String, String>();	
315
	    	for(String docId: results){
316
	    	for(String docId: results){
316
	    	    String snippet = CategorySnippetCacheWrapper.getSnippet(docId);
317
	    	    String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.CATEGORY_SNIPPET_CACHE_KEY, docId, sourceId);
317
	    	    if (snippet != null) {
318
	    	    if (snippet != null) {
318
	    	        snippets.put(docId, snippet);
319
	    	        snippets.put(docId, snippet);
319
	    	    }
320
	    	    }
320
			}
321
			}
321
    	}
322
    	}