与SolR 1.4合并索引 [英] Merging index with SolR 1.4

查看:97
本文介绍了与SolR 1.4合并索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Solr 1.4,并且我想测试mergeindexes.

I'm working with Solr 1.4, and I want to test mergeindexes.

想象一下以下这些核心(A和B):

Imagine these following Cores (A and B) :

http://img59.imageshack.us/img59/5804/coreaandb.png

在核心"A"中,存在与核心B中具有相同ID的文档.

In the core "A", there are document that have the same id than in core B.

我想将这两个核心合并为一个核心C.目标是获得一个包含合并文档(基于id)的核心C.

I want to merge these two core into a core C. The goal is to get a core C which contains merged documents (based on id).

例如,我想将以下文档放入核心C:

For example, I want to get the following document into the core C :

  • id:1
  • 标题:rambo
  • 标签:超级

如果我调用mergeindexes方法,则会得到以下核心C:

If I call the mergeindexes method, I get the following core C :

http://img440.imageshack.us/img440/6818/coremerged.png

您知道是否可以合并文档吗?

Do you know if it's possible to get merged documents ?

感谢您的帮助,

Antoine

推荐答案

您可以使用SolrJ或您喜欢的任何客户端平台来完成此客户端.

You could do this client-side using SolrJ or whatever client platform you prefer.

伪代码:

while documents in core B:
  let docsB = docb1, docb2, ..., docb10 = fetch 10 documents from core B
  let docsA = fetch documents from core A where id:docb1 OR id:docb2 OR ... id:docb10
  for db,da in zip(docsB, docsA):
    let docC = merge(db,da)
    add docC to Solr core C

这篇关于与SolR 1.4合并索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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