Subversion Repositories SmartDukaan

Rev

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

Rev 3185 Rev 3273
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.SearchSnippetCacheWrapper;
4
import in.shop2020.serving.services.SolrSearchService;
5
import in.shop2020.serving.services.SolrSearchService;
5
import in.shop2020.serving.utils.FileUtils;
6
import in.shop2020.serving.utils.FileUtils;
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
 
Line 205... Line 206...
205
    	return "index";
206
    	return "index";
206
    }
207
    }
207
 
208
 
208
 
209
 
209
    public Map<String, String> getSnippets() throws Exception {
210
    public Map<String, String> getSnippets() throws Exception {
210
    	if(results != null){
211
        if(results != null){
211
    		snippets = new HashMap<String, String>();	
212
            snippets = new HashMap<String, String>();   
212
	    	for(String docId: results){
213
            for(String docId: results){
213
				snippets.put(docId, FileUtils.read( Utils.EXPORT_ENTITIES_PATH + docId + File.separator +"SearchSnippet.html"));
214
                String snippet = SearchSnippetCacheWrapper.getSnippet(docId);
-
 
215
                if (snippet != null) {
-
 
216
                    snippets.put(docId, snippet);
-
 
217
                }
214
			}
218
            }
215
    	}
219
        }
216
		return snippets;
220
        return snippets;
217
    }
221
    }
218
	
222
	
219
    /**
223
    /**
220
     * 
224
     * 
221
     * @return
225
     * @return