优化k8s配置
This commit is contained in:
@@ -21,6 +21,11 @@ spec:
|
||||
project: fangjia-bkoff
|
||||
app: fangjia
|
||||
spec:
|
||||
hostAliases:
|
||||
- ip: 192.168.0.38
|
||||
hostnames:
|
||||
- seaweed.db.fangjia.com
|
||||
- foo.local
|
||||
imagePullSecrets:
|
||||
- name: nexus-registry-secret
|
||||
nodeSelector:
|
||||
|
||||
+4
-4
@@ -131,7 +131,7 @@ public class SolrServerImpl implements SolrServer
|
||||
private void addToSolr0(final HttpSolrServer solrServer, final List<SolrInputDocument> documents, int errorCount) {
|
||||
try {
|
||||
if (null != documents && !documents.isEmpty()) {
|
||||
solrServer.add((Collection)documents);
|
||||
solrServer.add(documents);
|
||||
solrServer.commit();
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public class SolrServerImpl implements SolrServer
|
||||
if (doc.get("$boosts") != null && doc.get("$boosts") instanceof Map) {
|
||||
boostsMap = (Map<String, Float>)doc.get("$boosts");
|
||||
if (boostsMap.containsKey("$doc_boost")) {
|
||||
document.setDocumentBoost(boostsMap.get("$doc_boost").floatValue());
|
||||
document.setDocumentBoost(((Number) boostsMap.get("$doc_boost")).floatValue());
|
||||
}
|
||||
}
|
||||
for (final Index index : indexes) {
|
||||
@@ -235,10 +235,10 @@ public class SolrServerImpl implements SolrServer
|
||||
final Object value = doc.get(key);
|
||||
final SolrInputField field = new SolrInputField(key);
|
||||
if (value instanceof ObjectId) {
|
||||
field.setValue((Object)value.toString(), 1.0f);
|
||||
field.setValue(value.toString(), 1.0f);
|
||||
}
|
||||
else if (boostsMap != null && boostsMap.containsKey(key)) {
|
||||
field.setValue(value, boostsMap.get(key).floatValue());
|
||||
field.setValue(value, ((Number) boostsMap.get(key)).floatValue());
|
||||
}
|
||||
else {
|
||||
field.setValue(value, 1.0f);
|
||||
|
||||
@@ -149,8 +149,5 @@ import org.apache.commons.lang.StringUtils
|
||||
// item["B"] = RegionData.formatRegion(item["A"], item["B"])
|
||||
// println(item)
|
||||
//})
|
||||
int count = 0
|
||||
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery("东莞")).each {def a->
|
||||
count += 1
|
||||
}
|
||||
println(count)
|
||||
DbUtils.seaweed.save(DbUtils.seaweed.findById("62ce26483705890001dfa166"))
|
||||
//DbUtils.seaweed.remove(new BasicDBObject("_id", "62ce3eda3705890001dfa16a"))
|
||||
|
||||
Reference in New Issue
Block a user