问题
I have a DB containing many tables, and every table has different properties, and I want to achive the following:
Create and index on all of the properties (from every table).
The problem is that I don't have a class for every table for I have used dynamic classes to insert them to the DB.
So how can I create an index that given a string will return all documents that one of their properties contains that string?
Another problem needed to be solved is that in future Tables insertion I can add the new table to the index I explained above.
Thanks, David
回答1:
David, You don't have tables in RavenDB, but that aside, you can just define an index over the entire data set, like this:
from doc in docs select new { doc.Name }
Which will define an index over all types, allowing you to query over all the documents' names.
来源:https://stackoverflow.com/questions/11073667/ravendb-multi-map