Subversion Repositories SmartDukaan

Rev

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

Rev 2070 Rev 2147
Line 32... Line 32...
32
 */
32
 */
33
public class SolrSearchService {
33
public class SolrSearchService {
34
	/**
34
	/**
35
	 * 
35
	 * 
36
	 */
36
	 */
37
	private static Logger log = Logger.getLogger(Class.class);	
37
	private static Logger log = Logger.getLogger(Class.class);
38
	/**
-
 
39
	 * 
-
 
40
	 */
-
 
41
	private static final int PERCENTAGE_OF_TOTAL_RESULTS = 2;
-
 
42
	
38
	
43
	/**
39
	/**
44
	 * 
40
	 * 
45
	 */
41
	 */
46
	public static final String SOLR_URL;
42
	public static final String SOLR_URL;
Line 187... Line 183...
187
	
183
	
188
	public TreeMap<String,HashMap<String,Integer>> getFacetMap() {
184
	public TreeMap<String,HashMap<String,Integer>> getFacetMap() {
189
		facetMap = new TreeMap<String,HashMap<String,Integer>>();
185
		facetMap = new TreeMap<String,HashMap<String,Integer>>();
190
		
186
		
191
		String facetNamePath = "/response/lst/lst[@name = 'facet_fields']/lst";
187
		String facetNamePath = "/response/lst/lst[@name = 'facet_fields']/lst";
192
		String facetValuePath = "/response/lst/lst[@name = 'facet_fields']/lst/int/@name";
-
 
193
		String facetCountPath = "/response/lst/lst[@name = 'facet_fields']/lst/int";
-
 
194
		
188
		
195
		NodeList nodes = null;
189
		NodeList nodes = null;
196
		try {
190
		try {
197
			nodes = (NodeList) this.xpath.evaluate(facetNamePath, this.inputSource, XPathConstants.NODESET);
191
			nodes = (NodeList) this.xpath.evaluate(facetNamePath, this.inputSource, XPathConstants.NODESET);
198
		}
192
		}
Line 532... Line 526...
532
	    	"Talk time"
526
	    	"Talk time"
533
    	};
527
    	};
534
 
528
 
535
		 */
529
		 */
536
    	String[] facetDefIDs = new String[] {"Category","F_50002","F_50001",  "F_50006", "F_50007" };
530
    	String[] facetDefIDs = new String[] {"Category","F_50002","F_50001",  "F_50006", "F_50007" };
537
    	String[] facetLabels = new String[] {"Category","Price", "Brand", "Data Connectivity", "Camera Resolution"	};
531
    	//String[] facetLabels = new String[] {"Category","Price", "Brand", "Data Connectivity", "Camera Resolution"	};
538
 
532
 
539
    	
533
    	
540
    	String[] fqrys = {};
534
    	String[] fqrys = {};
541
		SolrSearchService search = new SolrSearchService("nokia", fqrys, facetDefIDs, 0 , 20, null, null, 10000, null);
535
		SolrSearchService search = new SolrSearchService("nokia", fqrys, facetDefIDs, 0 , 20, null, null, 10000, null);
542
    	
536