Subversion Repositories SmartDukaan

Rev

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

Rev 3278 Rev 3561
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.datalogger.EventType;
3
import in.shop2020.datalogger.EventType;
-
 
4
import in.shop2020.serving.cache.EhcacheWrapper.CacheKeys;
4
import in.shop2020.serving.cache.SearchSnippetCacheWrapper;
5
import in.shop2020.serving.cache.SnippetCacheWrapper;
5
import in.shop2020.serving.services.SolrSearchService;
6
import in.shop2020.serving.services.SolrSearchService;
6
import in.shop2020.serving.utils.Utils;
7
import in.shop2020.serving.utils.Utils;
7
import in.shop2020.utils.DataLogger;
8
import in.shop2020.utils.DataLogger;
8
 
9
 
9
import java.io.UnsupportedEncodingException;
10
import java.io.UnsupportedEncodingException;
Line 57... Line 58...
57
	private long page = 1;
58
	private long page = 1;
58
	private long totalResults;
59
	private long totalResults;
59
	private long beginIndex = 0;
60
	private long beginIndex = 0;
60
	private String url;
61
	private String url;
61
	private String priceUrl = "?";
62
	private String priceUrl = "?";
62
	private long categoryId=10000;
63
	private long categoryId = Utils.ROOT_CATEGORY;
63
	private String sortUrl;
64
	private String sortUrl;
64
	private String location;
65
	private String location;
65
	/**
66
	/**
66
	 * 
67
	 * 
67
	 * @return
68
	 * @return
Line 156... Line 157...
156
    	}
157
    	}
157
    	url = urlCrumb;
158
    	url = urlCrumb;
158
 
159
 
159
    	
160
    	
160
    	
161
    	
161
    	SolrSearchService search = new SolrSearchService(query, fqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, categoryId, sortOrder);
162
    	SolrSearchService search = new SolrSearchService(query, fqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, categoryId, sortOrder, sourceId);
162
 
163
 
163
    	this.results =  search.getResultMap(); 
164
    	this.results =  search.getResultMap(); 
164
    	
165
    	
165
    	// Facets
166
    	// Facets
166
    	
167
    	
Line 207... Line 208...
207
 
208
 
208
    public Map<String, String> getSnippets() throws Exception {
209
    public Map<String, String> getSnippets() throws Exception {
209
        if(results != null){
210
        if(results != null){
210
            snippets = new HashMap<String, String>();   
211
            snippets = new HashMap<String, String>();   
211
            for(String docId: results){
212
            for(String docId: results){
212
                String snippet = SearchSnippetCacheWrapper.getSnippet(docId);
213
                String snippet = (String)SnippetCacheWrapper.getSnippet(CacheKeys.SEARCH_SNIPPET_CACHE_KEY, docId, sourceId);
213
                if (snippet != null) {
214
                if (snippet != null) {
214
                    snippets.put(docId, snippet);
215
                    snippets.put(docId, snippet);
215
                }
216
                }
216
            }
217
            }
217
        }
218
        }