lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tate Avery" <>
Subject Relational Search
Date Tue, 04 Nov 2003 18:28:15 GMT

I want to perform a 'relational search' meanining that I want to search 2 indexes and perform
an intersection between the 2.  It would be very much like a table join in an SQL statement
in terms of overall result.

So, I might have an index of documents of type A that would allow me to retrieve IDs.
And an index of documents of type B that would also return IDs of A type documents (like a
foreign key).

So, I want to find all documents of type A that match query X and also match query Y on the
B-type index.

Using SQL Server (with full-text search) it might be something like:

	SELECT FROM index1 a, index2 b 
	WHERE CONTAINS(a.body, 'x') 
	   AND = AND CONTAINS(b.title, 'y')

Doing my own intersection is not desirable (since loading the IDs from both results can be
very time-consuming).
And, building a huge boolean query that performs the intersection (by loading the smaller
ID set only) is still too slow.
I don't mind doing any extra work so long as I get an reasonably efficient relational search
in the end.

Does anyone have any creative ideas for tackling this problem with Lucene?

Thank you,

p.s.  Using the Multisearcher allows for easy unions  :) ... but not intersections.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message