13 jan 2007 kl. 19.14 skrev Kay Roepke:
All of the users (documents we index) are "connected" to certain
other users,
in a network fashion. We must be able to restrict the query (or
filter it after
searching the complete index) to certain "levels of connectedness",
i.e. you
can search within say three hops of yourself. We compute a list of
user ids
which are in the set of the applicable "contacts". This information
about
connection cannot be stored in the index, as it is changing often
and is
expensive to compute in advance.
Given you don't have too many users, you could do it the other way
around, storing
the distance to all users from each document.
But the bottom line really is that Lucene is not designed for this
sort of thing.
If I was you, I would make a filter that navigates an in heap object
graph of all
users and their connections using a breadth first (or perhaps even
A*). I'm
certain it will turn out to be much simpler to maintain, and probably
several
thousand times faster than implementing such a feature in the Lucene
storage.
http://en.wikipedia.org/wiki/Breadth-first_search
http://en.wikipedia.org/wiki/A%2A_search_algorithm
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]