...
|
...
|
@@ -77,12 +77,10 @@ public class SknImageVectorsServiceImpl implements ISknImageVectorsService, Appl |
|
|
logger.info("[func=searchSknByPhoto][param={}][begin={}]", paramMap.toString(), begin);
|
|
|
String vectors_32 = paramMap.get(VECTORS_32_KEY);
|
|
|
String vectors_128 = paramMap.get(VECTORS_128_KEY);
|
|
|
Integer viewNum = MapUtils.getInteger(paramMap, "viewNum",20);
|
|
|
//Integer viewNum = 20;
|
|
|
logger.warn("vectors_32 is [{}],vectors_128 is[{}]", vectors_32, vectors_128);
|
|
|
Integer viewNum = MapUtils.getInteger(paramMap, "viewNum", 20);
|
|
|
// Integer viewNum = 20;
|
|
|
// 2、按32维向量召回
|
|
|
List<Integer> sknListFromVector32 = this.querySknListWithVector32(vectors_32);
|
|
|
logger.warn("sknListFromVector32 size is [{}]", sknListFromVector32.size());
|
|
|
if (sknListFromVector32.isEmpty()) {
|
|
|
return new SearchApiResult().setData(this.getResultsDataData(viewNum, null));
|
|
|
}
|
...
|
...
|
@@ -117,7 +115,7 @@ public class SknImageVectorsServiceImpl implements ISknImageVectorsService, Appl |
|
|
final String indexName = ISearchConstants.INDEX_NAME_IMAGE_VECTORS;
|
|
|
SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam);
|
|
|
List<Integer> sknResults = getSknResultsFromImageVectors(searchResult.getResultList());
|
|
|
logger.warn("[func=querySknListWithVector32][query with vector_32][resultsize is {}][cost={}]", sknResults.size(), System.currentTimeMillis() - begin);
|
|
|
logger.info("[func=querySknListWithVector32][query with vector_32][resultsize is {}][cost={}]", sknResults.size(), System.currentTimeMillis() - begin);
|
|
|
return sknResults;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -136,7 +134,7 @@ public class SknImageVectorsServiceImpl implements ISknImageVectorsService, Appl |
|
|
final String indexName = ISearchConstants.INDEX_NAME_IMAGE_VECTORS;
|
|
|
SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam);
|
|
|
List<Integer> sknResults = getSknResultsFromImageVectors(searchResult.getResultList());
|
|
|
logger.warn("[func=querySknListWithVector128][query with vector_128][resultsize is {}][cost={}]", searchResult.getResultList().size(), System.currentTimeMillis() - begin);
|
|
|
logger.info("[func=querySknListWithVector128][query with vector_128][resultsize is {}][cost={}]", searchResult.getResultList().size(), System.currentTimeMillis() - begin);
|
|
|
return sknResults;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -161,8 +159,8 @@ public class SknImageVectorsServiceImpl implements ISknImageVectorsService, Appl |
|
|
}
|
|
|
// 3、排序截取
|
|
|
List<Map<String, Object>> productList = searchResult.getResultList();
|
|
|
logger.warn("[func=queryProductListWithSort][query by sknList][resultsize is {}][cost={}]",productList.size(), System.currentTimeMillis() - begin);
|
|
|
|
|
|
logger.info("[func=queryProductListWithSort][query by sknList][resultsize is {}][cost={}]", productList.size(), System.currentTimeMillis() - begin);
|
|
|
|
|
|
Map<Integer, Map<String, Object>> productMap = new HashMap<Integer, Map<String, Object>>();
|
|
|
for (Map<String, Object> product : productList) {
|
|
|
productMap.put(MapUtils.getInteger(product, "productSkn", 0), product);
|
...
|
...
|
|