Commit dc06c651 by zhiwei

修复不同表索引创建问题

parent 9ce337bb
...@@ -69,7 +69,11 @@ public enum MongoDBTemplate { ...@@ -69,7 +69,11 @@ public enum MongoDBTemplate {
ListIndexesIterable<Document> indexList = mongoCollection.listIndexes(); ListIndexesIterable<Document> indexList = mongoCollection.listIndexes();
if(Objects.isNull(indexList)){ if(Objects.isNull(indexList)){
Document countIndexDoc = new Document(); Document countIndexDoc = new Document();
countIndexDoc.put("score_num", -1); if(collectionName.contains("hot_search_list")){
countIndexDoc.put("count", -1);
}else{
countIndexDoc.put("score_num", -1);
}
Document timeIndexDoc = new Document(); Document timeIndexDoc = new Document();
timeIndexDoc.put("time", -1); timeIndexDoc.put("time", -1);
Document rankIndexDoc = new Document(); Document rankIndexDoc = new Document();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment