|
|
|
@ -14,7 +14,6 @@ import com.fr.general.http.HttpToolbox;
|
|
|
|
|
import com.fr.json.JSONArray; |
|
|
|
|
import com.fr.json.JSONException; |
|
|
|
|
import com.fr.json.JSONObject; |
|
|
|
|
import com.fr.json.JSONTokener; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.CodeUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
@ -61,8 +60,6 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
|
|
|
|
|
try { |
|
|
|
|
String result = HttpToolbox.get(AlphaFineConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j])); |
|
|
|
|
AlphaFineHelper.checkCancel(); |
|
|
|
|
Object json = new JSONTokener(result).nextValue(); |
|
|
|
|
if (json instanceof JSONObject) { |
|
|
|
|
JSONObject jsonObject = new JSONObject(result); |
|
|
|
|
if (jsonObject.optString("status").equals("success")) { |
|
|
|
|
JSONArray jsonArray = jsonObject.optJSONArray("result"); |
|
|
|
@ -77,7 +74,6 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (JSONException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error("recommend search error! :" + e.getMessage()); |
|
|
|
|
} catch (IOException e) { |
|
|
|
@ -94,6 +90,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
|
|
|
|
|
} |
|
|
|
|
complementAdviceModelList = ComplementAdviceManager.getInstance().getAllSearchResult(searchText); |
|
|
|
|
moreModelList.clear(); |
|
|
|
|
|
|
|
|
|
if (recommendModelList.size() > 0) { |
|
|
|
|
if (complementAdviceModelList.size() == 0) { |
|
|
|
|
if (recommendModelList.size() > AlphaFineConstants.SHOW_SIZE - 2) { |
|
|
|
|