我想在上传一些初始数据后更新Solr建议词典(在Solr 5.3.1中)。删除所有数据并上传修改后的数据后,更新建议词典。但是当我删除任何特定记录(例如id = 123)时,建议者仍然会在结果集中返回已删除的记录。
例如,
json_data.json
[
{
"id": 1,
"name": "New York"
},
{
"id": 2,
"name": "New Jersey"
},
{
"id": 3,
"name": "California"
}
]
使用此命令:
curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/mycollection/update?commit=true' --data-binary @json_data.json
本地主机:8983 / solr的/ MyCollection的/选择Q = %3A &安培;重量= JSON&安培;缩进=真
{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
"q": "*:*",
"indent": "true",
"wt": "json",
"_": "1448271522315"
}
},
"response": {
"numFound": 3,
"start": 0,
"docs": [
{
"id": "1",
"name": [
"New York"
],
"_version_": 1518622755181822000
},
{
"id": "2",
"name": [
"New Jersey"
],
"_version_": 1518622755186016300
},
{
"id": "3",
"name": [
"California"
],
"_version_": 1518622755187064800
}
]
}
}
本地主机:8983 / solr的/ MyCollection的/建议Q =最新及安培;重量= JSON&安培;缩进=真
{
"responseHeader": {
"status": 0,
"QTime": 0
},
"spellcheck": {
"suggestions": [
"New",
{
"numFound": 2,
"startOffset": 0,
"endOffset": 3,
"suggestion": [
"New Jersey",
"New York"
]
}
],
"collations": [
"collation",
"(New Jersey)"
]
}
}
现在我删除" New Jersey"使用以下命令从mycollection: curl http://localhost:8983/solr/mycollection/update?commit=true -H" Content-Type:text / xml" --data-binary'(id:2)'
现在,select query仅返回剩余的2条记录(已删除" New Jersey")
本地主机:8983 / solr的/ MyCollection的/选择Q = %3A &安培;重量= JSON&安培;缩进=真
{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
"q": "*:*",
"indent": "true",
"wt": "json",
"_": "1448272061874"
}
},
"response": {
"numFound": 2,
"start": 0,
"docs": [
{
"id": "1",
"name": [
"New York"
],
"_version_": 1518622755181822000
},
{
"id": "3",
"name": [
"California"
],
"_version_": 1518622755187064800
}
]
}
}
本地主机:8983 / solr的/ MyCollection的/建议Q =最新及安培;重量= JSON&安培;缩进=真
{
"responseHeader": {
"status": 0,
"QTime": 0
},
"spellcheck": {
"suggestions": [
"New",
{
"numFound": 2,
"startOffset": 0,
"endOffset": 3,
"suggestion": [
"New Jersey",
"New York"
]
}
],
"collations": [
"collation",
"(New Jersey)"
]
}
}
我在重新加载管理核心并重新启动solr服务器后尝试但结果保持不变。
可能是什么问题?请问组件(solr.SpellCheckComponent)是否使用了缓存?如果是,可以如何清除?
任何帮助都将不胜感激。