1
0
Fork 0

Count fix & tests enabled

This commit is contained in:
Simon Grätzer 2017-05-06 01:57:09 +02:00
parent 646979acce
commit 59a514bb89
5 changed files with 10 additions and 12 deletions

View File

@ -487,11 +487,15 @@ Result RocksDBFulltextIndex::executeQuery(transaction::Methods* trx,
auto physical = static_cast<RocksDBCollection*>(_collection->getPhysical());
auto idx = physical->primaryIndex();
std::set<std::string>::iterator it = resultSet.cbegin();
ManagedDocumentResult mmdr;
if (maxResults == 0) {// 0 appearantly means "all results"
maxResults = SIZE_T_MAX;
}
builder.openArray();
// get the first N results
std::set<std::string>::iterator it = resultSet.cbegin();
while (maxResults > 0 && it != resultSet.cend()) {
RocksDBToken token = idx->lookupKey(trx, StringRef(*it));
if (token.revisionId()) {

View File

@ -218,11 +218,11 @@ function dumpTestSuite () {
assertTrue(c.getIndexes()[6].sparse);
assertEqual([ "a_ss1", "a_ss2" ], c.getIndexes()[6].fields);
if (db._engine().name !== "rocksdb") {
assertFalse(c.getIndexes()[7].unique);
assertEqual("fulltext", c.getIndexes()[7].type);
assertEqual([ "a_f" ], c.getIndexes()[7].fields);
assertFalse(c.getIndexes()[7].unique);
assertEqual("fulltext", c.getIndexes()[7].type);
assertEqual([ "a_f" ], c.getIndexes()[7].fields);
if (db._engine().name !== "rocksdb") {
assertEqual("geo2", c.getIndexes()[8].type);
assertEqual([ "a_la", "a_lo" ], c.getIndexes()[8].fields);
assertFalse(c.getIndexes()[8].unique);

View File

@ -114,8 +114,8 @@
c.ensureHashIndex("a_hs1", "a_hs2", { sparse: true });
c.ensureSkiplist("a_ss1", "a_ss2", { sparse: true });
c.ensureFulltextIndex("a_f");
if (db._engine().name !== "rocksdb") {
c.ensureFulltextIndex("a_f");
c.ensureGeoIndex("a_la", "a_lo");
}

View File

@ -1356,9 +1356,6 @@ function transactionOperationsSuite () {
////////////////////////////////////////////////////////////////////////////////
testCreateFulltextIndex : function () {
if (db._engine().name === "rocksdb") {
return;
}
c1 = db._create(cn1);
@ -1975,9 +1972,6 @@ function transactionOperationsSuite () {
////////////////////////////////////////////////////////////////////////////////
testFulltext : function () {
if (db._engine().name === "rocksdb") {
return;
}
c1 = db._create(cn1);
var idx = c1.ensureFulltextIndex("text");