The more I play with querying, the more I'm realizing I can *only* get
back results if FieldIndexing is set to Analyzed. In Analyzed, the
string equals operator == basically acts like String.Contains:
docStore.DatabaseCommands.PutIndex(
"FindFoo",
new IndexDefinition<Foo, Foo>
{
Map = items =>
from item in items
select new
{
item.ExactMatchValue,
item.FuzzyMatchValue
},
Indexes =
{
{ item => item.ExactMatchValue, FieldIndexing.NotAnalyzed },
{ item => item.FuzzyMatchValue, FieldIndexing.Analyzed }
}
},
true);
...
docSession.Store(new Foo
{
ExactMatchValue = "Lucene must match this exactly",
FuzzyMatchValue = "Lucene must match this fuzzily",
});
docSession.Store(new Foo
{
ExactMatchValue = "Lucene must match this exactly 2",
FuzzyMatchValue = "Lucene must match this fuzzily 2",
});
...
var exactResults = docSession.Query<Foo>("FindFoo").Where(foo =>
foo.ExactMatchValue == "Lucene must match this exactly").ToList(); //
Count == 0
var fuzzyResults = docSession.Query<Foo>("FindFoo").Where(foo =>
foo.FuzzyMatchValue == "Lucene must match this fuzzily").ToList(); //
Count == 2
I'm using Build 95 in case that matters. What am I doing wrong?