更新 SOLR 索引上的特定字段 [英] Update specific field on SOLR index

查看:27
本文介绍了更新 SOLR 索引上的特定字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 solr 搜索文章

I want to using solr for search on articles

我有 3 张桌子:

  1. 组(id,组名)
  2. ArticleBase(id、groupId、其他一些字段)
  3. 文章(id, articleBaseId, title, date, ...)

在 solr schema.xml 文件中,我只定义了与 ArticleBase 表混合的所有文章字段(用于在 solr 上使用一个索引),如下所示:(id, articleBaseId, groupId, ...)

in solr schema.xml file i just define all article field that mixed with ArticleBase table (for use one index on solr) like this: (id, articleBaseId, groupId, ...)

问题:管理员想要更改组 (ArticleBase),因此我必须更新(或替换)solr 中的所有索引文章.对 ?
我可以只在solr索引中更新groupId吗?

problem: Admin want to change group (ArticleBase), therefore i must update (or replace) all indexed article in solr. right ?
can i update groupId only in solr index ?

有什么解决办法吗?

注意:文章表包含2亿多篇文章,我只使用solr做索引(除了文章id不存储任何字段数据)

Note:Article table contains more than 200 million article, and i using solr for index only (not store any field data except article id)

推荐答案

Solr 不支持更新个别字段,但有一个JIRA 问题(撰写本文时快 3 岁了).

Solr does not support updating individual fields yet, but there is a JIRA issue about this (almost 3 years old as of this writing).

在实施之前,您必须更新整个文档.

Until this is implemented, you have to update the whole document.

UPDATE:从 Solr 4+ 开始实现,这是文档.

UPDATE: as of Solr 4+ this is implemented, here's the documentation.

这篇关于更新 SOLR 索引上的特定字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆