Subversion Repositories SmartDukaan

Rev

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

Rev 6520 Rev 6842
Line 121... Line 121...
121
    	if(this.request.getParameter("maxPrice") != null){
121
    	if(this.request.getParameter("maxPrice") != null){
122
    		this.maxPrice = (new Double(this.request.getParameter("maxPrice")));
122
    		this.maxPrice = (new Double(this.request.getParameter("maxPrice")));
123
    		url= url + "&maxPrice=" + this.request.getParameter("maxPrice");
123
    		url= url + "&maxPrice=" + this.request.getParameter("maxPrice");
124
    	}
124
    	}
125
    	
125
    	
126
    	if (type==0) {
126
    	if (type!=0) {
127
	    	String sortOrder = "F_50002+asc";
127
    		query = "*&fq=F_50029:"+uri;
128
	    	
-
 
129
	    	SolrSearchService search = new SolrSearchService(query, fqrys, Utils.facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, 10000, sortOrder, sourceId);
-
 
130
	    	this.results =  search.getResultMap(); 
-
 
131
	
-
 
132
	    	
-
 
133
	    	this.facets = new LinkedHashMap<String, List<String[]>>();
-
 
134
	    	String qryString = this.request.getQueryString();
-
 
135
	    	log.info("qryString=" + qryString);
-
 
136
	    	
-
 
137
	    	for (int i=0; i<Utils.facetDefIDs.length; i++) {
-
 
138
	    		String facetDefID = Utils.facetDefIDs[i];
-
 
139
	    		String facetLabel = Utils.facetLabels[i];
-
 
140
	    		Map<String, Integer> facetDetailMap = search.getFacetDetails(facetDefID);
-
 
141
	    		if(facetDetailMap==null)
-
 
142
	    			continue;
-
 
143
	    		List<String[]> values = new ArrayList<String[]>();
-
 
144
	    		String drilldownURL = url + "&fq=" + facetDefID + ":";
-
 
145
	    		for(Entry<String, Integer> facetEntry: facetDetailMap.entrySet()){
-
 
146
	    		    String facet = facetEntry.getKey();
-
 
147
	
-
 
148
	    			String[] afacet = new String[] { facet, 
-
 
149
	      					facetEntry.getValue().toString(), drilldownURL  + URLEncoder.encode(facet, "UTF-8")  };
-
 
150
	
-
 
151
	      			values.add(afacet);
-
 
152
	    		}
-
 
153
	    		
-
 
154
	    		this.facets.put(facetLabel, values);
-
 
155
	    	}
-
 
156
	
-
 
157
	    	Map<String, Double> priceMap = search.getPriceStatsMap();
-
 
158
	    	if(priceMap != null){
-
 
159
	    		this.minPrice = priceMap.get("min");
-
 
160
	    		this.maxPrice = priceMap.get("max");
-
 
161
	    	}
-
 
162
	    	else{
-
 
163
	    		this.minPrice = 0.0;
-
 
164
	    		this.maxPrice = 0.0;
-
 
165
	    	}
-
 
166
	
-
 
167
	    	this.totalResults = search.getTotalResults();
-
 
168
	        return "index";
-
 
169
    	} else {
-
 
170
    		return "tag-index";
-
 
171
    	}
128
    	}
-
 
129
    		
-
 
130
    	String sortOrder = "F_50002+asc";
-
 
131
    	
-
 
132
    	SolrSearchService search = new SolrSearchService(query, fqrys, Utils.facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, 10000, sortOrder, sourceId);
-
 
133
    	this.results =  search.getResultMap(); 
-
 
134
 
-
 
135
    	
-
 
136
    	this.facets = new LinkedHashMap<String, List<String[]>>();
-
 
137
    	String qryString = this.request.getQueryString();
-
 
138
    	log.info("qryString=" + qryString);
-
 
139
    	
-
 
140
    	for (int i=0; i<Utils.facetDefIDs.length; i++) {
-
 
141
    		String facetDefID = Utils.facetDefIDs[i];
-
 
142
    		String facetLabel = Utils.facetLabels[i];
-
 
143
    		Map<String, Integer> facetDetailMap = search.getFacetDetails(facetDefID);
-
 
144
    		if(facetDetailMap==null)
-
 
145
    			continue;
-
 
146
    		List<String[]> values = new ArrayList<String[]>();
-
 
147
    		String drilldownURL = url + "&fq=" + facetDefID + ":";
-
 
148
    		for(Entry<String, Integer> facetEntry: facetDetailMap.entrySet()){
-
 
149
    		    String facet = facetEntry.getKey();
-
 
150
 
-
 
151
    			String[] afacet = new String[] { facet, 
-
 
152
      					facetEntry.getValue().toString(), drilldownURL  + URLEncoder.encode(facet, "UTF-8")  };
-
 
153
 
-
 
154
      			values.add(afacet);
-
 
155
    		}
-
 
156
    		
-
 
157
    		this.facets.put(facetLabel, values);
-
 
158
    	}
-
 
159
 
-
 
160
    	Map<String, Double> priceMap = search.getPriceStatsMap();
-
 
161
    	if(priceMap != null){
-
 
162
    		this.minPrice = priceMap.get("min");
-
 
163
    		this.maxPrice = priceMap.get("max");
-
 
164
    	}
-
 
165
    	else{
-
 
166
    		this.minPrice = 0.0;
-
 
167
    		this.maxPrice = 0.0;
172
    }
168
    	}
-
 
169
 
-
 
170
    	this.totalResults = search.getTotalResults();
-
 
171
        return "index";
-
 
172
	}
-
 
173
    
173
    
174
    
174
    public String getPageMetaDesc() {
175
    public String getPageMetaDesc() {
175
    	return "Best price " + this.facetSelection + this.specialPageName.replaceAll("Phones", "mobile phones") 
176
    	return "Best price " + this.facetSelection + this.specialPageName.replaceAll("Phones", "mobile phones") 
176
    	    + " mobile phones in India. Experience n' buy online. FREE Next Day delivery. Original product - Full manufacturer warranty. Comprehensive reviews."; 
177
    	    + " mobile phones in India. Experience n' buy online. FREE Next Day delivery. Original product - Full manufacturer warranty. Comprehensive reviews."; 
177
    }
178
    }