开发者

Merging index with SolR 1.4

开发者 https://www.devze.com 2023-01-28 20:45 出处:网络
I\'m working with Solr 1.4, and I want to test mergeindexes. Imagine these following Cores (A and B) :

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

Imagine these following Cores (A and B) :

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

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

I want to merge these two core into a core C. The goal is to get a core C which contains merged docu开发者_开发问答ments (based on id).

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

  • id : 1
  • title : rambo
  • tag : super

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

http://localhost:8080/solr/admin/multicore?action=mergeindexes&core=coreC&indexDir=../../coreA/data/index&indexDir=../../coreB/data/index

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

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

Thanks for your help,

Antoine


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

Pseudocode:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消