SearchKit and SKIndexDocumentIterator
SearchKit and SKIndexDocumentIterator
- Subject: SearchKit and SKIndexDocumentIterator
- From: Sebastian Krauß <email@hidden>
- Date: Fri, 28 Nov 2003 13:50:40 +0100
Hello everybody,
so, I started using SearchKit. Indexing and searching works fine.
However, I need to iterate over all documents in an index. What I'm
currently doing is this:
// "index" is a valid reference to an index of documents
SKDocumentRef docRef = SKIndexCopyDocumentForDocumentID(index,
SKIndexGetMaximumDocumentID(index));
SKIndexDocumentIteratorRef iterator =
SKIndexDocumentIteratorCreate(index, docRef);
SKDocumentRef thisDoc = SKIndexDocumentIteratorCopyNext(iterator);
while (thisDoc != NULL)
{
// Do something with the document
CFRelease(thisDoc);
thisDoc = SKIndexDocumentIteratorCopyNext(iterator);
}
For clarification: I use SKIndexGetMaximumDocumentID() because this is
the only function I could find to get a reference to a concrete
document. I also tried NULL as an argument to
SKIndexDocumentIteratorCreate(), but whatever I do, it iterates over
_exactly one_ document, though SKIndexGetDocumentCount() returns 400
which seems about right.
Is there another way to get references to all documents in an index? Or
can anybody tell me what I'm doing wrong?
Any help is very much appreciated, I'm somewhat desperate.
Sebastian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.