Comments (5)
This module just replaces the values with i18n: true
with an object that contains the values of all defined languages, so cross-language searches are not directly supported. You should check the mongoose api to find what you are looking for.
from mongoose-i18n-localize.
Yeah, already looked into this quite deeply. It seems when you have a dynamic key for an object there's no way to do a search across all keys (something like {'name.*': /searchstring/}
), unless you declare them in advance and enumerate the individual keys. Then you end up with a million $or
s and huge objects with redundant keys.
That also means for my app I would have to declare all potential languages.
This was also a problem when I was working with MySQL, where you could serialize a string, but then it removed the possibility of indexing it properly.
from mongoose-i18n-localize.
You need to declare all potentials languages anyway, so the best option would be to write a wrapper that does what you describe above.
from mongoose-i18n-localize.
Thanks. Still not finalised exactly how I'm going to do this with a search facility unless search on the client end is done using separate languages.
from mongoose-i18n-localize.
How did you made that work? Even if I specify each language in the index it won't work.
posts.index({
'title.fr': 'text',
'title.en': 'text'
});
edit: or you went with the manual regex way? That seem to work but it's not pretty and won't work well with french special character.
from mongoose-i18n-localize.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-i18n-localize.