Query two indexes and store output into new index


(Gurveer Singh) #1

Hi,

I have two indexes with different data but both indexes has mutual filed Roll Number. Following is example:

student_index has following data
Roll Number: 123456
Name: Bob
Last Name: Michel
Class: 8th

finance_index has following data
Roll Number: 123456
Fee: 8000

I want to query both index based on roll no and expected output is:
Roll Number: 123456
Name: Bob
Last Name: Michel
Class: 8th
Fee: 8000

and want to store output in 3rd index final_student_index.

I have approximately 23000 records, how I can achieve this and what is best way to do such task.


(Emmanuel Rouby) #2

Hello,

an algo like that could do the job:

Retrieve through a scroll request the whole index student_index
Retrieve through a scroll request the whole index finance_index
make consolidated objects using a loop on student_index data
bulk that new list into a new index.

23000 documents x 3 is easy to process in memory by a program in c# or java..

if there are too many documents, the algo could be like that :

begin to scroll the student_index.
At each scroll, make a multiget or search into finance_data on Roll Number retrieved.
Consolidate
Bulk
Next scroll...

Anyway, it would be interesting to directly build one consolidated index... like indexing a 'final_student_index' the equivalent of student_index, and, instead of mounting the finance_index, do an update of 'final_student_index' to add the "Fee" field.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.