|
|
|
@ -313,6 +313,9 @@ public final class plasmaWordIndexEntity {
|
|
|
|
|
|
|
|
|
|
public static plasmaWordIndexEntity joinEntities(Set entities, long time) throws IOException {
|
|
|
|
|
|
|
|
|
|
// big problem here: there cannot be a time-out for join, since a time-out will leave the joined set too big.
|
|
|
|
|
// this will result in a OR behavior of the search instead of an AND behavior
|
|
|
|
|
|
|
|
|
|
long stamp = System.currentTimeMillis();
|
|
|
|
|
|
|
|
|
|
// order entities by their size
|
|
|
|
@ -339,7 +342,7 @@ public final class plasmaWordIndexEntity {
|
|
|
|
|
// we now must pairwise build up a conjunction of these sets
|
|
|
|
|
Long k = (Long) map.firstKey(); // the smallest, which means, the one with the least entries
|
|
|
|
|
plasmaWordIndexEntity searchA, searchB, searchResult = (plasmaWordIndexEntity) map.remove(k);
|
|
|
|
|
while ((map.size() > 0) && (searchResult.size() > 0) && (time > 0)) {
|
|
|
|
|
while ((map.size() > 0) && (searchResult.size() > 0)) {
|
|
|
|
|
// take the first element of map which is a result and combine it with result
|
|
|
|
|
k = (Long) map.firstKey(); // the next smallest...
|
|
|
|
|
time -= (System.currentTimeMillis() - stamp); stamp = System.currentTimeMillis();
|
|
|
|
|