DIRTY DEMO HACKS
diff --git a/src/main/java/de/ids_mannheim/korap/KorapCollection.java b/src/main/java/de/ids_mannheim/korap/KorapCollection.java
index b2b47b8..6c33c7c 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapCollection.java
@@ -117,7 +117,7 @@
log.trace("Added extension: {}", filter.toString());
this.filter.add(
new FilterOperation(
- (Filter) new QueryWrapperFilter(filter.toQuery()),
+ (Filter) new QueryWrapperFilter(filter.toQuery()),
true
)
);
@@ -142,9 +142,6 @@
public FixedBitSet bits (AtomicReaderContext atomic) throws IOException {
/*
- TODO:
- Don't check the live docs in advance - combine them afterwards with an "and" operation,
- so before this you can fully use "and" and "or" on an empty bitset.
Use Bits.MatchAllBits(int len)
*/
@@ -159,13 +156,14 @@
FilterOperation kcInit = filters.remove(0);
log.trace("FILTER: {}", kcInit);
-
// Init vector
DocIdSet docids = kcInit.filter.getDocIdSet(atomic, null);
+
DocIdSetIterator filterIter = docids.iterator();
if (filterIter != null) {
log.trace("InitFilter has effect");
+ // System.err.println("Init has an effect");
bitset.or(filterIter);
noDoc = false;
};
@@ -183,11 +181,18 @@
if (kc.isFilter()) {
bitset.clear(0, bitset.length());
noDoc = true;
+ }
+ else {
+ // System.err.println("No term found");
};
continue;
};
if (kc.isExtension()) {
+ // System.err.println("Term found!");
+ // log.trace("Extend filter");
+ // System.err.println("Old Card:" + bitset.cardinality());
bitset.or(filterIter);
+ // System.err.println("New Card:" + bitset.cardinality());
}
else {
bitset.and(filterIter);
diff --git a/src/main/java/de/ids_mannheim/korap/KorapIndex.java b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
index 2c5ae31..3f93cd1 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
@@ -332,8 +332,13 @@
};
long docCount = 0;
+ // System.err.println("CHECK");
+ int i = 1;
for (AtomicReaderContext atomic : this.reader().leaves()) {
+ // System.err.println("READER" + i + "a-" + docCount);
docCount += collection.bits(atomic).cardinality();
+ // System.err.println("READER" + i + "b-" + docCount);
+ i++;
};
return docCount;
};
diff --git a/src/main/java/de/ids_mannheim/korap/KorapQuery.java b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
index b76b7b8..0ee3895 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
@@ -171,12 +171,18 @@
};
value = value.replace("'", "").replace("\"", "");
+ // Temporary
+ value = value.replace("_", "/");
+
return this.seg(this.re(value));
};
if (!value.matches("[^:]+?:.+"))
value = "s:" + value;
+ // Temporary
+ value = value.replace("_", "/");
+
return this.seg(value);
case "!=":
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index a4c83b7..e050a57 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -11,7 +11,7 @@
#log4j.logger.de.ids_mannheim.korap.query.spans.MatchSpans = TRACE, stdout
#log4j.logger.de.ids_mannheim.korap.KorapIndex = TRACE, stdout
#log4j.logger.de.ids_mannheim.korap.KorapMatch = TRACE, stdout
-#log4j.logger.de.ids_mannheim.korap.KorapCollection = TRACE, stdout
+# log4j.logger.de.ids_mannheim.korap.KorapCollection = TRACE, stdout
#log4j.logger.de.ids_mannheim.korap.index.PositionsToOffset = TRACE, stdout
# log4j.logger.de.ids_mannheim.korap.analysis.MultiTermTokenStream = TRACE, stdout