Authored by 胡古飞

fix

... ... @@ -26,9 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import com.alibaba.fastjson.JSON;
import com.carrotsearch.hppc.ObjectLookupContainer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.yoho.search.base.utils.ISearchConstants;
... ... @@ -183,7 +181,6 @@ public class SearchExplainerService {
break;
}
}
// 只有所有token都匹配成功才返回true
queryMatchResult = queryMatchResult && isTokenMatched;
}
... ... @@ -194,10 +191,6 @@ public class SearchExplainerService {
map.put("data", resultList);
map.put("searchTokens", searchTokens);
map.put("queryMatchResult", queryMatchResult);
logger.warn("explain show info with JSON is :" + JSON.toJSONString(map));
logger.warn("explain show info with ObjectMapper is :" + new ObjectMapper().writeValueAsString(map));
logger.info("End to show skn tokens. skn={}, keyword={}, cost={}.", skn, keyword, System.currentTimeMillis() - start);
return map;
}
... ... @@ -213,8 +206,7 @@ public class SearchExplainerService {
String fieldValueStr = fieldValue != null ? fieldValue.toString() : null;
List<String> tokens = getAnalyzerResult(fieldDesc, fieldValueStr);
searchFieldResult.setFieldValue(fieldValueStr);
searchFieldResult.setTokens(tokens);
searchFieldResult.setTokens(Arrays.asList(StringUtils.join(tokens, ";")));
return searchFieldResult;
}
... ...