I have documents collection “Messages” in my base (RavenDB)
Document definition like:
class Message
{
string Content;
Tag[] Tags;
Location[] Locations;
string[] Actions;
bool IsActive;
}
Tag class definition:
class Tag
{
string Value;
Translation[] Translations;
}
Location class:
class Location
{
string Code;
Translation[] Translations;
}
Translation class:
class Translation
{
string LanguageCode;
string Value;
}
So, I want to create a index that will allow me to make queries by several fields:
- Full-text search by Message.Content
- Only messages with IsActive==true
- Messages that contains my action in Message.Actions
- Messages that contains tag with myValue and myLanguageCode
- Locations that contains location with some myCode and myLanguageCode
I would like to query to be on all the conditions simultaneously
So, how should i define index for RavenDB?
Well, after a short studies of RavenDB auto dynamic indexes i created something like