In RavenDB Studio, I can view 69 CustomVariableGroup documents. My query returns only 66 of them. After some digging, I see that three documents that have not been returned have a new class structure: the property has been deleted. Since I saved these three CustomVariableGroup documents, their structure is different from the other 66. Why, though, when I request all of them, I can only get the remaining 66 documents with the old structure?
Both my C # code and my request in LinqPad, return 66. Here's the LinqPad request:
Session.Query<CustomVariableGroup>().Dump();
But if I do this, I can get one of three documents that are not in the above request:
Session.Query<CustomVariableGroup>().Where(x => x.Name == "Derating").Dump();
How can I get all 69 documents returned in one request?
** Edit: Index Information **
On the SQL tab of the LinqPad query (and on the output of the Raven server), the index looks like this:
Url: / indexes / dynamic / CustomVariableGroups? query = & start = 0 & pageSize = 128 & aggregation = None
I do not see this index in Raven Studio, presumably because it is dynamic.
** Edit 2: This HACK works **
If I do this, I will receive all 69 documents:
Session.Query<CustomVariableGroup>().Where(x => x.Name != string.Empty).Dump();
I assume Raven should use an old index that only gets documents that still contain this remote column. I somehow need to use a new / different index ...
Interestingly, this does not work; it returns only 66:
Session.Query<CustomVariableGroup>().Where(x => x.Id != string.Empty).Dump();
** Edit 3: This HACK also works **
Session.Advanced.LuceneQuery<CustomVariableGroup>("Raven/DocumentsByEntityName").Where("Tag:CustomVariableGroups").Dump();