How to update range of dynamic fields in Solr 4?

I have the following field in a my Solr 4 schema Which I can update atomically using below this which works great and leaves other fields alone {"add":{"doc":{"id":"111","rank_350":{"set":"1"},"rank_391":{"set":"4"}}}, "add":{"doc":{"id":"222","rank_350":{"set":"1"},"rank_391":{"set":"4"}}}} Now I want to clear any existing ranks before updating with new ones, without having to query what they are first. If I use approach above and upated with just new rank the old two would remain there since update is atomic. I have tried using the wildcard within one post or with other updates but solr thinks there is a field called rank_* rather than apply null setting to all ranks. {"add":{"doc":{"id":"111","rank_*":{"set":"null"}}} **How can I apply an update to all rank_* dynamic fields?** Reason is I don't want to have to query first to see what was there before as I will be batch updating up to 200 at one time (this can be done in one post). If I had to query that would be 201 posts rather than 1, or changing my event to know what had been removed which is also difficult.

以上就是How to update range of dynamic fields in Solr 4?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JSON 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准