Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink 1.10 - Multi-Index Support #160

Closed
bchavez opened this issue Nov 5, 2013 · 2 comments
Closed

Rethink 1.10 - Multi-Index Support #160

bchavez opened this issue Nov 5, 2013 · 2 comments

Comments

@bchavez
Copy link
Collaborator

bchavez commented Nov 5, 2013

If I'm not mistaken, currently, there's no support for the "multi-index" parameter when creating indexes ...

http://rethinkdb.com/blog/1.10-release/

{
  ...,
  "tags": ["feature", "ReQL", "secondary_indexes"],
  ...
}

r.table('github_issues').index_create('tags', multi=true).run(conn)
r.table('github_issess').get_all('feature', index='tags')

And the official documentation for multi-index support: http://www.rethinkdb.com/api/javascript/index_create/

So, looking at the C# driver code, I stumbled upon: CreateIndexQuery.cs. It appears, that all we need to do to support the multi index parameter is attach a "multi" datum to "indexCreate.optargs"?

Something like this:

indexCreate.optargs.Add( new Term.AssocPair
                {
                    key = "multi",
                    val = new Term
                        {
                            type = Term.TermType.DATUM,
                            datum = new Datum
                                {
                                    type = Datum.DatumType.R_BOOL,
                                    r_bool = true | false ???
                                }
                        }
                } );

I'm not really sure about the structures of Term specs. So, it's only a guess. If it's this easy, perhaps I could write it. Please advise. thx.

@mfenniak
Copy link
Owner

mfenniak commented Nov 5, 2013

Looks like you've nailed what would be needed here. The addition of the optarg as you've described, plus:

  • A new field in CreateIndexQuery (readonly, set by constructor)
  • An optional parameter to Query.IndexCreate to pass into the CreateIndexQuery constructor; default false
  • A unit test

@dragan
Copy link
Collaborator

dragan commented Nov 5, 2013

Just a small note, the CI mono agent was already running 1.10.0, but I just finished updating to 1.10.1 so we're all set on the CI side for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants