Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

51237 create query text index #17

Merged
merged 1 commit into from
Oct 30, 2015
Merged

Conversation

rhyshort
Copy link
Member

How

Add additional functionality to CDTCreateQueryIndexOperation to handle the creation of text indexes. This does bring in some repeated code around validation of sort syntax. However PR #12 brings in a validator class, which should be used here.

Testing

Test are found in the CreateIndexTests.m file

Usage

    CDTCreateQueryIndexOperation *index = [[CDTCreateQueryIndexOperation alloc] init];
    index.fields = @[ @{ @"day" : @"asc" } ];
    index.selector = @{ @"foo" : @"bar" };
    index.defaultFieldEnabled = NO;
    index.indexType = CDTQueryIndexTypeText;
    index.createIndexCompletionBlock = ^(NSError *error) {
         if(error){ /* encountered an error */ return}

        //do something about it completing
    };
    [self.database addOperation:index];

@rhyshort rhyshort force-pushed the 51237-create-query-text-index branch 2 times, most recently from 2b764ef to 9d90e19 Compare October 29, 2015 14:17

- (BOOL)buildAndValidateJsonIndex
{
// check if the text only things have been used
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be clearer -- "Check whether any text index specific attributes are set; fail if they are"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 20abf19

@mikerhodes
Copy link
Member

+1 once GH issue filed to check on case sensitivity.

@rhyshort
Copy link
Member Author

Issue #18 opened

Added the ability for CDTCreateQueryIndex to create text indexes in
addition to JSON indexes.
@rhyshort rhyshort force-pushed the 51237-create-query-text-index branch from 20abf19 to f191d13 Compare October 30, 2015 13:40
rhyshort added a commit that referenced this pull request Oct 30, 2015
@rhyshort rhyshort merged commit 3cdac54 into master Oct 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants