2016-07-22 88 views
0

我目前正在使用Solr 5.1並面臨錯誤,我不想在文檔中更新日期字段。我是使用HTTP連接solr的更新文檔。下面的URL是我如何更新到solr ..忽略特定字段更新到Solr文檔

http://localhost:8080/solr/collection1/update?commit=true 

當我更新文件時,一切都是更新。我不想在我的文檔中更新日期字段。我嘗試使用原子更新,但它不能按照我想要的方式工作。下面是例子,我如何更新文檔,

[ 
{ 
    "id": "http://myitmakhamediagroup.com/test/json/test/234", 
    "content": {"set": "blah blah blah"}, 
    "data": {"set": "blahblahblah"}, 
    "timestamp":"2016-12-19T15:44:46Z" 
} 
] 

這是我如何更新文件退出到Solr,我並沒有把組現場當時郵票,但它也更新。我不知道該怎麼做。

有沒有人給我建議如何忽略來自solr索引文件的特定字段的更新,或者我是否需要更改solr模式以便不更新時間戳特定字段?

回答

0

不要發送時間戳,如果你不想更新:

[ 
{ 
    "id": "http://myitmakhamediagroup.com/test/json/test/234", 
    "content": {"set": "blah blah blah"}, 
    "data": {"set": "blahblahblah"} 
} 
]