Subversion Repositories SmartDukaan

Rev

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

Rev 6881 Rev 6931
Line 27... Line 27...
27
import org.apache.struts2.convention.annotation.Result;
27
import org.apache.struts2.convention.annotation.Result;
28
import org.apache.struts2.convention.annotation.Results;
28
import org.apache.struts2.convention.annotation.Results;
29
import org.apache.struts2.rest.DefaultHttpHeaders;
29
import org.apache.struts2.rest.DefaultHttpHeaders;
30
import org.apache.struts2.rest.HttpHeaders;
30
import org.apache.struts2.rest.HttpHeaders;
31
 
31
 
-
 
32
import com.google.gson.Gson;
32
import com.opensymphony.xwork2.ActionContext;
33
import com.opensymphony.xwork2.ActionContext;
33
 
34
 
34
/**
35
/**
35
 * @author rajveer
36
 * @author rajveer
36
 *
37
 *
Line 47... Line 48...
47
 
48
 
48
	private List<String> results;
49
	private List<String> results;
49
	private Map<String, String> snippets;
50
	private Map<String, String> snippets;
50
	private Map<String, List<String[]>> facets;
51
	private Map<String, List<String[]>> facets;
51
	private Map<String, List<List<String>>> crumbs;
52
	private Map<String, List<List<String>>> crumbs;
-
 
53
	private Map<String, Double> dynamicSearchMap;
52
	/**
54
	/**
53
	 * 
55
	 * 
54
	 */
56
	 */
55
	private String id;
57
	private String id;
56
	
58
	
Line 206... Line 208...
206
 
208
 
207
    	String sortOrder = "F_50028+asc,F_50030+desc";
209
    	String sortOrder = "F_50028+asc,F_50030+desc";
208
    	
210
    	
209
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, Utils.ROOT_CATEGORY, sortOrder, sourceId);
211
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, Utils.ROOT_CATEGORY, sortOrder, sourceId);
210
    	this.results =  search.getResultMap(); 
212
    	this.results =  search.getResultMap(); 
-
 
213
    	this.dynamicSearchMap =  search.getDynamicPriceMap();
211
 
214
 
212
    	setFacet(Arrays.asList(newfqrys), search);
215
    	setFacet(Arrays.asList(newfqrys), search);
213
 
216
 
214
    	
217
    	
215
    	Map<String, Double> priceMap = search.getPriceStatsMap();
218
    	Map<String, Double> priceMap = search.getPriceStatsMap();
Line 377... Line 380...
377
	}
380
	}
378
    
381
    
379
    public List<String> getChildren(String categoryLabel) {
382
    public List<String> getChildren(String categoryLabel) {
380
    	return SearchController.getCategoriesChildren().get(categoryLabel);
383
    	return SearchController.getCategoriesChildren().get(categoryLabel);
381
    }
384
    }
-
 
385
    
-
 
386
	public String getDynamicSearchMap(){
-
 
387
    	if (this.dynamicSearchMap == null) {
-
 
388
    		return "{}";
-
 
389
    	} else {
-
 
390
    		return new Gson().toJson(this.dynamicSearchMap);
-
 
391
    	}
-
 
392
    }
382
}
393
}
383
394