Subversion Repositories SmartDukaan

Rev

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

Rev 1733 Rev 2053
Line 31... Line 31...
31
 
31
 
32
	private List<String> results = null;
32
	private List<String> results = null;
33
 
33
 
34
	private Map<String, String> snippets;
34
	private Map<String, String> snippets;
35
	
35
	
36
	private String sortOrder = null;
36
	private String sortOrder = "F_50002 desc";
37
	private Double minPrice = null;
37
	private Double minPrice = null;
38
	private Double maxPrice = null;
38
	private Double maxPrice = null;
39
 
39
 
40
	private long windowSize = 10;
40
	private long windowSize = 30;
41
	private long page = 1;
41
	private long page = 1;
42
	private long totalResults = 0;
42
	private long totalResults = 0;
43
	private long categoryId = 10000;
43
	private long categoryId = 10000;
-
 
44
	
-
 
45
	private boolean hasSearched = false;
44
 
46
 
45
	public MyPhonesController(){
47
	public MyPhonesController(){
46
		snippets = new HashMap<String, String>();
48
		snippets = new HashMap<String, String>();
47
	}
49
	}
48
	
50
	
Line 58... Line 60...
58
	    	String[] facetDefIDs = new String[]{}; //new String[] {"F_50010"};
60
	    	String[] facetDefIDs = new String[]{}; //new String[] {"F_50010"};
59
			
61
			
60
			SolrSearchService search = new SolrSearchService(query, fqrys, facetDefIDs, (page - 1) * windowSize, windowSize, minPrice, maxPrice, categoryId, sortOrder);
62
			SolrSearchService search = new SolrSearchService(query, fqrys, facetDefIDs, (page - 1) * windowSize, windowSize, minPrice, maxPrice, categoryId, sortOrder);
61
			this.totalResults = search.getTotalResults();
63
			this.totalResults = search.getTotalResults();
62
			this.results = search.getResultMap();
64
			this.results = search.getResultMap();
-
 
65
			this.hasSearched = true;
63
		}
66
		}
64
		return "index";
67
		return "index";
65
	}
68
	}
66
 
69
 
67
    public List<String> getResults()	{
70
    public List<String> getResults()	{
Line 80... Line 83...
80
//    		snippets.put("1001211", FileUtils.read("/home/varungupta/snippets/SearchSnippet3.html"));
83
//    		snippets.put("1001211", FileUtils.read("/home/varungupta/snippets/SearchSnippet3.html"));
81
//    		snippets.put("1001223", FileUtils.read("/home/varungupta/snippets/SearchSnippet4.html"));
84
//    		snippets.put("1001223", FileUtils.read("/home/varungupta/snippets/SearchSnippet4.html"));
82
 
85
 
83
    		for(String docId: results){
86
    		for(String docId: results){
84
	    		String html = FileUtils.read(Utils.EXPORT_ENTITIES_PATH + docId + File.separator + "PhonesIOwnSnippet.html");
87
	    		String html = FileUtils.read(Utils.EXPORT_ENTITIES_PATH + docId + File.separator + "PhonesIOwnSnippet.html");
85
	    		System.out.println(Utils.EXPORT_ENTITIES_PATH + docId + File.separator + "PhonesIOwnSnippet.html");
-
 
86
				snippets.put(docId, html);
88
				snippets.put(docId, html);
87
			}
89
			}
88
    	}
90
    	}
89
		return snippets;
91
		return snippets;
90
    }
92
    }
Line 101... Line 103...
101
	@Override
103
	@Override
102
	public void setServletContext(ServletContext context) {
104
	public void setServletContext(ServletContext context) {
103
		this.context = context;
105
		this.context = context;
104
	}
106
	}
105
	
107
	
-
 
108
	public boolean getHasSearched()	{
-
 
109
		return this.hasSearched;
-
 
110
	}
-
 
111
	
106
	public String getServletContextPath(){
112
	public String getServletContextPath(){
107
		return context.getContextPath();
113
		return context.getContextPath();
108
	}
114
	}
109
}
115
}
110
116