title: RavenDB: How to use Multi Maps / Reduce indexes
body: <p>I have quite simple model:</p>
  
  <pre><code>public class PhraseMeta:
  {
   public int Id { get; set; }
   public string ModuleName { get; set; }
   public string Description { get; set; }
   public DateTime ModifiedDate { get; set; }
  }
  
  public class Phrase
  {
    public int Id { get; set; }
    public int PhraseMetaId { get; set; } //reference to PhraseMeta
    public string Language { get; set; }
    public string Text { get; set; }
  }
  </code></pre>
  
  <p>Phrase contains some translations and PhraseMeta has meta information for several Phrases.
  I am trying to find Phrase's Text having ModuleName and Language. 
  As I understood RavenDB's Multi Maps / Reduce indexes feature can help with it instead of using WhereEntityIs.
  My index is:</p>
  
  <pre><code>public class PhraseEntry
  {
    public string MetaId { get; set; }
    public string ModuleName { get; set; }
    public string Language { get; set; }
    public string Text { get; set; } 
  }
  
  public class PhraseTranslationIndex : AbstractMultiMapIndexCreationTask&lt;PhraseEntry&gt;
  {
    public PhraseTranslationIndex()
    {
      this.AddMap&lt;PhraseMeta&gt;(phraseMetas =&gt; from pm in phraseMetas
                   select new
                   {
                     MetaId = pm.Id,
                     ModuleName = pm.ModuleName,
                     Language = (string)null,
                     Text = (string)null
                   });
  
      this.AddMap&lt;Phrase&gt;(phrases =&gt; from phrase in phrases
                 select new
                 {
                   MetaId = phrase.PhraseMetaId,
                   ModuleName = (string)null,
                   Language = phrase.Language,
                   Text = phrase.Text
                 });
  
      this.Reduce = results =&gt; from entry in results
                   group entry by entry.MetaId
                     into g
                     select new
                     {
                       MetaId = g.Key,
                       ModuleName = g.Select(x =&gt; x.ModuleName).Where(x =&gt; x != null).First(),
                       Language = g.Select(x =&gt; x.Language).Where(x =&gt; x != null).First(),
                       Text = g.Select(x =&gt; x.Text).Where(x =&gt; x != null).First()
                     };
  
      this.Index(x =&gt; x.ModuleName, FieldIndexing.Analyzed);
      this.Index(x =&gt; x.Language, FieldIndexing.Analyzed);
      this.Index(x =&gt; x.Text, FieldIndexing.Analyzed);
    }
  }
  </code></pre>
  
  <p>This is how I am trying to use it:</p>
  
  <pre><code>var entry = documentSession.Query&lt;PhraseEntry, PhraseTranslationIndex&gt;
                             .Where(p =&gt; p.ModuleName == "MyModule")
                             .Where(p =&gt; p.Language == "en")
                             .FirstOrDefault();
  </code></pre>
  
  <p>And this index has no results. I am using build 472. </p>
  
  <p>Any ideas?</p>