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
Reserved field name 'language' causes trouble. [DATAMONGO-1049] #1892
Comments
Christoph Strobl commented Only having a field named Therefore it would be really helpful if you could provide a little more information on what you types look like or add a sample reproducing the error. Using any of the text search features of MongoDB v2.0.2 would not work as this is something introduced in the 2.6 version |
Christoph Guse commented Hi Christoph, thanks for your reply. One of the critical class is this one
I renamed the member variable "language" to "lang" which did not help. Changing the field mapping to "lang" helped and the above mentioned exception was thrown for anoter language member variable. I also used MongoDB v2.6 for testing purposes which did not change anything. Searching all my sources for " |
Christoph Strobl commented Thanks Christoph Guse I think I can now nail it down. The error occurs whenever you've more than one property referring to a language property. @Document
class A {
@Id String id;
@FIeld("language") String lang;
B b;
}
class B {
String language;
} During Type inspection we scan for potential index structures. The language property is a special one for text index and therefore recognized - though no index creation will be triggered if there is not at least one Long story short, we'll fix that - sorry for inconvenience and thanks for reporting! |
Christoph Guse opened DATAMONGO-1049 and commented
With having support for full-text-search there seem to be a problem having MongoDB field names 'language'.
In a legacy project (with legacy data) there are several entities having a member variable 'language' with are using the field name 'language' in MongoDB.
This causes the exception
In the current Implementation MongoPersistentEntityIndexResolver checks in line 233 if the persistentProperty is a language property. Each object member variable using a field name 'language' is recognized as languageProperty.
There should be an annotation like
@NoLanguage
to mark all member variables which have noting to do with the MongoDB full text searchAffects: 1.6 M1 (Evans), 1.6 GA (Evans)
Reference URL: http://stackoverflow.com/questions/25687121/how-to-disable-full-text-search-in-spring-data-mongodb-1-6-0-rc1
Issue Links:
("is depended on by")
Referenced from: pull request #224
Backported to: 1.6.1 (Evans SR1)
The text was updated successfully, but these errors were encountered: