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