tags:

views:

28

answers:

1

Hi I need the search using another search result. can anyone help me? My scenario is

I have index1 with fields fileid, filename, filetype, lastmodified, created etc.

I have index2 with fields fileid, f1,f2,f3,f4,f5 , where f1 - f5 all are boolean fields and holds value 0/1.

Now I want to filter my search result for eg., filtype:pdf with all the fileid having that holds 1 for the field f5.

How can I achieve this without filtering, since I m dealing with millions of records and filter will loop through each and every hit.

Can anyone help me ASAP? Thanks in advance

-Ranga

A: 

There is no such a function in Lucene that would search one index filtering by results of search on another index. If such a function had existed it would loop through results of the first search and perform second search. You should either merge two indexes into one or perform second query by yourself.

I suppose that there is a reason to have you indexes separated. Probably your second index is updated much frequently than the first one. In this case you could consider keeping it in relational DBMS.

Yaroslav