On Feb 23, 2014, at 1:25 PM, Todd Freese <[email protected]> wrote:
> It always returns all the docs. If I break the full text query code out into
> a test method, it shows that it is in fact returning the correct docs. But
> the tableview is showing the wrong docs.
I think the way you initialize the query is triggering a race condition:
self.dataSource.query = [Job searchJobsInDatabase:database].asLiveQuery;
self.dataSource.query.fullTextQuery = @"999";
The datasource will start the query as soon as you set it (in the first line).
So by the time you set the .fullTextQuery property, the query's already
running. There isn't currently any support in CBLLiveQuery for changing query
options in mid-stream, so it'll just keep running with the original options.
This code should work:
CBLLiveQuery* query = [Job searchJobsInDatabase:database].asLiveQuery;
query.fullTextQuery = @"999";
self.dataSource.query = query;
--Jens
--
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/6EF29D87-715F-4B08-9870-E53F90E95A89%40couchbase.com.
For more options, visit https://groups.google.com/groups/opt_out.