Subversion Repositories SmartDukaan

Rev

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

Rev 12333 Rev 19565
Line 7... Line 7...
7
import in.shop2020.config.ConfigException;
7
import in.shop2020.config.ConfigException;
8
import in.shop2020.serving.controllers.SearchController;
8
import in.shop2020.serving.controllers.SearchController;
9
import in.shop2020.serving.utils.Utils;
9
import in.shop2020.serving.utils.Utils;
10
import in.shop2020.thrift.clients.config.ConfigClient;
10
import in.shop2020.thrift.clients.config.ConfigClient;
11
 
11
 
-
 
12
import java.net.URI;
-
 
13
import java.net.URL;
-
 
14
import java.net.URLDecoder;
12
import java.util.ArrayList;
15
import java.util.ArrayList;
13
import java.util.Arrays;
16
import java.util.Arrays;
14
import java.util.Collections;
17
import java.util.Collections;
15
import java.util.HashMap;
18
import java.util.HashMap;
16
import java.util.HashSet;
19
import java.util.HashSet;
Line 202... Line 205...
202
        }
205
        }
203
        String minString = "0";
206
        String minString = "0";
204
        String maxString = "*";  
207
        String maxString = "*";  
205
        if(minPrice != null || maxPrice != null){
208
        if(minPrice != null || maxPrice != null){
206
            try {
209
            try {
207
                dynamicPriceMap = getPriceStatsMap(new InputSource(uri)); 
210
                dynamicPriceMap = getPriceStatsMap(new InputSource(toUri(uri))); 
208
            } catch (Exception e){
211
            } catch (Exception e){
209
                e.printStackTrace();
212
                e.printStackTrace();
210
            }
213
            }
211
            if(minPrice != null){
214
            if(minPrice != null){
212
                minString = minPrice.toString();
215
                minString = minPrice.toString();
Line 224... Line 227...
224
                    uri += "&facet.field=" + facetDefinitionID;
227
                    uri += "&facet.field=" + facetDefinitionID;
225
                }
228
                }
226
        }
229
        }
227
        log.info("uri=" + uri);
230
        log.info("uri=" + uri);
228
        
231
        
229
        this.inputSource = new InputSource(uri);
232
        this.inputSource = new InputSource(toUri(uri));
230
 
233
 
231
        this.facetMap = getFacetMap();
234
        this.facetMap = getFacetMap();
232
    }
235
    }
233
 
236
 
234
    @SuppressWarnings("unchecked")
237
    @SuppressWarnings("unchecked")
Line 719... Line 722...
719
    
722
    
720
    public Map<String, Double> getDynamicPriceMap() {
723
    public Map<String, Double> getDynamicPriceMap() {
721
        return this.dynamicPriceMap;
724
        return this.dynamicPriceMap;
722
    }
725
    }
723
    
726
    
-
 
727
	public String toUri(String string){
-
 
728
	    try {
-
 
729
	        String decodedURL = URLDecoder.decode(string, "UTF-8");
-
 
730
	        URL url = new URL(decodedURL);
-
 
731
	        URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); 
-
 
732
	        return uri.toASCIIString(); 
-
 
733
	    } catch (Exception ex) {
-
 
734
	        ex.printStackTrace();
-
 
735
	        return null;
-
 
736
	    }
-
 
737
	}
-
 
738
    
724
}
739
}