Subversion Repositories SmartDukaan

Rev

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

Rev 20209 Rev 20213
Line 31... Line 31...
31
	private SolrService s =  new SolrService();
31
	private SolrService s =  new SolrService();
32
 
32
 
33
 
33
 
34
	public String index() throws URISyntaxException, IOException{
34
	public String index() throws URISyntaxException, IOException{
35
		try{
35
		try{
-
 
36
			log.info("Calling solr service for search_text "+search_text);
36
		String jsonString = s.getSuggestions(search_text.trim());
37
			String jsonString = s.getSuggestions(search_text.trim());
37
		result_json = Json.parse(jsonString).asObject().get("grouped").asObject();
38
			result_json = Json.parse(jsonString).asObject().get("grouped").asObject();
38
		setResultJson(sanatizedResults().toString());
39
			setResultJson(sanatizedResults().toString());
39
		}
40
		}
40
		catch(Exception e){
41
		catch(Exception e){
41
			e.printStackTrace();
42
			e.printStackTrace();
42
			setResultJson(Json.array().asArray().toString());
43
			setResultJson(Json.array().asArray().toString());
43
		}
44
		}
Line 81... Line 82...
81
		if (max_accessory_score <= max_mobile_score){
82
		if (max_accessory_score <= max_mobile_score){
82
			for (JsonValue j : temp_accesories){
83
			for (JsonValue j : temp_accesories){
83
				output.add(j);
84
				output.add(j);
84
			}
85
			}
85
		}
86
		}
86
		
87
 
87
		log.info("====================================");
88
		log.info("====================================");
88
		log.info("Final output "+output);
89
		log.info("Final output "+output);
89
		
90
 
90
		return output;
91
		return output;
91
	}
92
	}
92
 
93
 
93
	private JsonArray getResults(int category_id){
94
	private JsonArray getResults(int category_id){
94
 
95
 
Line 160... Line 161...
160
		return output;
161
		return output;
161
	}
162
	}
162
 
163
 
163
 
164
 
164
	public void setSearch_text(String search_text) {
165
	public void setSearch_text(String search_text) {
-
 
166
		log.info("Search text "+search_text);
165
		this.search_text = search_text;
167
		this.search_text = search_text;
166
	}
168
	}
167
 
169
 
168
 
170
 
169
	public String getSearch_text() {
171
	public String getSearch_text() {