[CDRIVER-904] Text search index creation failure in legacy index creation Created: 02/Oct/15  Updated: 19/Oct/16  Resolved: 12/Oct/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.1.11
Fix Version/s: 1.2.0

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

mongoc-collection.c

 761    if (opt->default_language != def_opt->default_language) {                         
 762       bson_append_utf8 (&insert,                                                     
 763                         "defaultLanguage", -1,                                       
 764                         opt->default_language, -1);                                  
 765    }                                                                                 
 766                                                                                      
 767    if (opt->language_override != def_opt->language_override) {                       
 768       bson_append_utf8 (&insert,                                                     
 769                         "languageOverride", -1,                                      
 770                         opt->language_override, -1);                                 
 771    }                                                                                 
 772                                                                               

The options are called default_language and language_override not camelCased

http://docs.mongodb.org/manual/reference/command/createIndexes/#dbcmd.createIndexes



 Comments   
Comment by Hannes Magnusson [ 12/Oct/15 ]

Thanks Pawel Szczurko!

Comment by Hannes Magnusson [ 12/Oct/15 ]

https://github.com/mongodb/mongo-c-driver/commit/2c1993b36fdc98f0a7ab1319294fb66ff2a638bd

Comment by Hannes Magnusson [ 04/Oct/15 ]

jesse it is correct according to the docs - but I filed the ticket so we could spend extra hour on figuring out how to test these create index methods to confirm they actually work. Since they don't error when the options are typoed its pretty sad thinking you have correctly created the index with the driver and have to spend lot of time trying to figureout why it doesn't work as advertised :/

behackett This is the actual option we send to the server, not the option name we expose the user (those_are_consistently_under_score).
The server however is veryInconsistentIfIt_uses_underscore_or_camelCaseForIndexOptions.

Comment by Bernie Hackett [ 04/Oct/15 ]

Since these two options have seemingly never worked, and all the other options use the camel case server names, should we do the opposite of this pull request?

Comment by A. Jesse Jiryu Davis [ 04/Oct/15 ]

Does https://github.com/mongodb/mongo-c-driver/pull/282 fix this correctly?

Generated at Wed Feb 07 21:10:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.