cloudant/CloudantQueryObjc — pull request #31 by mikerhodes (2014-11-03 11:04:31+00:00)
Title: Allow query over unindexed fields (#22)

This PR implements querying over unindexed fields. The changes are reasonably non-invasive, which surprised me:

1. Add class which can take a selector and a CDTDocumentRevsion and return whether the revision matches the selector.
- Supports the same operations we currently support on indexed fields.
- cd9d087
2. Update CDTQQueryExecutor and SqlTranslator to not fail when presented with a query including unindexed fields.
- Record whether there were any parts of the query the SQL processing couldn't support, so we know when the post hoc matching step must be run.
- Record when no parts of the query have supporting indexes, so the SqlTranslator can return a special-cased result which causes the all docIds to be read into the list for the post hoc matcher.
- 1dcc1a3
3. Update tests for query integration to run in three ways to make sure the SQL and post hoc matcher return the same results.
- Run the same tests three times:
- Normally, using both SQL indexes and the post hoc matcher.
- Using just SQL indexes.
- Using just the post hoc matcher.
- With the caveat that the "just SQL" case can't process queries with unindexed fields.
- This uses a feature of specta called shared behaviour, which is pretty nifty.
- 092b874

The main issue with this patch is that I needed to disable some of the invalid format tests. We need to move selector validation to a separate class, to avoid performing the validation in the SQL query engine and the post hoc matcher. This is filed as #30.