Subversion Repositories SmartDukaan

Rev

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

Rev 3329 Rev 3561
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.serving.cache.CategorySnippetCacheWrapper;
3
import in.shop2020.serving.cache.SnippetCacheWrapper;
-
 
4
import in.shop2020.serving.cache.EhcacheWrapper.CacheKeys;
4
import in.shop2020.serving.services.SolrSearchService;
5
import in.shop2020.serving.services.SolrSearchService;
5
import in.shop2020.serving.services.SpecialPageConfigurer;
6
import in.shop2020.serving.services.SpecialPageConfigurer;
6
 
7
 
7
import java.io.IOException;
8
import java.io.IOException;
8
import java.net.URLEncoder;
9
import java.net.URLEncoder;
Line 111... Line 112...
111
    	if(this.request.getParameter("maxPrice") != null){
112
    	if(this.request.getParameter("maxPrice") != null){
112
    		this.maxPrice = (new Double(this.request.getParameter("maxPrice")));
113
    		this.maxPrice = (new Double(this.request.getParameter("maxPrice")));
113
    		url= url + "&maxPrice=" + this.request.getParameter("maxPrice");
114
    		url= url + "&maxPrice=" + this.request.getParameter("maxPrice");
114
    	}
115
    	}
115
 
116
 
116
    	query = query + "&sort=F_50002+asc";
117
    	String sortOrder = "F_50002+asc";
117
 
118
    	
118
    	SolrSearchService search = new SolrSearchService(query, fqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, 10000, null);
119
    	SolrSearchService search = new SolrSearchService(query, fqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, 10000, sortOrder, sourceId);
119
    	this.results =  search.getResultMap(); 
120
    	this.results =  search.getResultMap(); 
120
 
121
 
121
    	
122
    	
122
    	this.facets = new LinkedHashMap<String, List<String[]>>();
123
    	this.facets = new LinkedHashMap<String, List<String[]>>();
123
    	String qryString = this.request.getQueryString();
124
    	String qryString = this.request.getQueryString();
Line 179... Line 180...
179
 
180
 
180
    public Map<String, String> getSnippets(){
181
    public Map<String, String> getSnippets(){
181
        if(results != null){
182
        if(results != null){
182
            snippets = new HashMap<String, String>();   
183
            snippets = new HashMap<String, String>();   
183
            for(String docId: results){
184
            for(String docId: results){
184
                String snippet = CategorySnippetCacheWrapper.getSnippet(docId);
185
	    	    String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.CATEGORY_SNIPPET_CACHE_KEY, docId, sourceId);
185
                if (snippet != null) {
186
                if (snippet != null) {
186
                    snippets.put(docId, snippet);
187
                    snippets.put(docId, snippet);
187
                }
188
                }
188
            }
189
            }
189
        }
190
        }