1
votes

I have two lucene indices. Suppose a document in the first Index contents fields like:

 name:....., filename: ......, fullpath: ........, etc.

and the second Index contents fields like:

 name: ....., deviceip: ......, etc.

Now what I need to do is: Search the first index with some query and then join the result with the documents in second index based upon common field (e.g. "name" in this case). The join should result such that the result contains fields from the second index as well.

Result:

name: ....., filename: ...., fullpath: ......., deviceip: ....., etc.

Is it possible to achieve with Lucene?

1
Do you mind if I ask why would you do that? I think it is better that you add the extra information to the other index and use a single index.amas
yes that is possible. but the problem would be there is going to be huge data redundancysabbir
were you able to solve this?Ayush choubey
No I have not able to solve this. Lucene doesn't give any such feature. Also after my extensive research, what I have found is what ever I was trying to achieve is very very expensive computation.sabbir

1 Answers

0
votes

Using BlockJoinQuery might solve your issue. You can refer to this blog post http://blog.mikemccandless.com/2012/01/searching-relational-content-with.html

You will end up creating an index that contains count(TableA) + count(TableB) docs (and not Count(TableA) x Count(TableB) ) and search that using a BlockJoinQuery.