I have defined an index with the following syntax:
public class TestCasesForConfigurationModeIndex
: AbstractIndexCreationTask<TestCase>
{
TestCasesForConfigurationModeIndex()
{
Map = docs => from x in docs select new { x.CurrentName }
Indexes.Add(x => x.CurrentName, FieldIndexing.Analyzed);
TransformResults = ... select new TestCaseForConfigurationMode { ... }
}
}
Querying this index via the Raven Studio works as expected, but how can I perform the same query using the LINQ API? The problem is that the "As" extension method is not availble for IDocumentQuery, but only for var query = _db.Advanced.LuceneQuery() .As().ToArray();
I also tried something like the following:
var results = _db.Advanced.LuceneQuery<TestCase, TestCasesForConfigurationModeIndex>()
.WhereEquals(x => x.CurrentName, searchExpression).Fuzzy((decimal)0.5);
.AsQueryable().As<TestCaseForConfigurationMode>().ToArray();
This kind of works (the server console shows me "Results: 7 returned out of 7 total." which is correct), but I don't get any results back (empty array).