Subversion Repositories SmartDukaan

Rev

Rev 569 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 569 Rev 790
Line 4... Line 4...
4
package in.shop2020.serving.services;
4
package in.shop2020.serving.services;
5
 
5
 
6
 
6
 
7
import java.util.Arrays;
7
import java.util.Arrays;
8
import java.util.HashMap;
8
import java.util.HashMap;
-
 
9
import java.util.LinkedList;
9
import java.util.Map;
10
import java.util.List;
10
import java.util.TreeMap;
11
import java.util.TreeMap;
11
 
12
 
12
 
13
 
13
import javax.xml.xpath.XPath;
14
import javax.xml.xpath.XPath;
14
import javax.xml.xpath.XPathConstants;
15
import javax.xml.xpath.XPathConstants;
Line 52... Line 53...
52
	 */
53
	 */
53
	private InputSource inputSource;
54
	private InputSource inputSource;
54
	
55
	
55
	TreeMap<String,HashMap<String,Integer>> facetMap;
56
	TreeMap<String,HashMap<String,Integer>> facetMap;
56
	
57
	
57
	HashMap<String, String[]> resultMap;
58
	List<String> resultMap;
58
	
59
	
59
	long numberOfResults=0;
60
	long numberOfResults=0;
60
	/**
61
	/**
61
	 * 
62
	 * 
62
	 * @param query
63
	 * @param query
Line 213... Line 214...
213
		facetMap = removeUnwantedFacets(facetMap, numberOfResults);
214
		facetMap = removeUnwantedFacets(facetMap, numberOfResults);
214
		System.out.println(facetMap);
215
		System.out.println(facetMap);
215
		return facetMap;
216
		return facetMap;
216
		}
217
		}
217
	
218
	
218
	public HashMap<String, String[]> getResultMap() {
219
	public List<String> getResultMap() {
219
		resultMap = new HashMap<String, String[]>();
220
		resultMap = new LinkedList<String>();
220
 
221
 
221
		String resultDocsPath = "/response/result/doc";
222
		String resultDocsPath = "/response/result/doc";
222
		
223
		
223
		
224
		
224
		NodeList nodes = null;
225
		NodeList nodes = null;
Line 234... Line 235...
234
		}
235
		}
235
		
236
		
236
		for(int i=0; i<nodes.getLength(); i++) {
237
		for(int i=0; i<nodes.getLength(); i++) {
237
			Node node = nodes.item(i);
238
			Node node = nodes.item(i);
238
			String docID = node.getFirstChild().getTextContent();
239
			String docID = node.getFirstChild().getTextContent();
239
			String[] values = new String[] {node.getFirstChild().getNextSibling().getTextContent()};
-
 
240
			resultMap.put(docID, values);	
240
			resultMap.add(docID);	
241
 		}
241
 		}
242
		System.out.println("resultMap is " + resultMap);
242
		System.out.println("resultMap is " + resultMap);
243
		return resultMap;
243
		return resultMap;
244
	}
244
	}
245
 
245