Hi,
I'm trying to index *104,000* documents containing 2 properties (name, id)
and it takes me *7-8 minutes* to index* all 104,000 documents*.
Here is my code:
com.couchbase.lite.View view = database.getView("companyName");
view.setMap(new Mapper() {
@Override
public void map(Map<String, Object> document,
Emitteremitter
) {
List<Object> compoundKey = new ArrayList<
Object>();
compoundKey.add(document.get("companyName"));
compoundKey.add(document.get("id"));
emitter.emit(compoundKey, null);
}
}, "1.5");
Query query = view.createQuery();
query.setLimit(40);
QueryEnumerator rowEnum;
try {
rowEnum = query.run();
if (rowEnum.getCount() > 0) {
for (int x = 0; x < 40; x++) {
QueryRow row = rowEnum.getRow(x);
companyList.add(row);
}
}
} catch (CouchbaseLiteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Is there anyway to make this faster? On iOS it goes on significantly
faster, on basically the same code flow.
Any ideas to point me in the right direction is greatly appreciated.
Thanks
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/abcc2620-c89a-4a0e-9e6f-90304d04ba35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.