title: Index not working with Raven DB, how to debug it?
body: <p>I have an index:</p>
  
  <pre><code>public class FreeSearchIndex : 
      AbstractIndexCreationTask&lt;Post, FreeSearchIndex.Result&gt;
  {
      public FreeSearchIndex()
      {
          Map = posts =&gt; from post in posts
                         select new
                            {
                                Query = post.Tags.Concat(new[]
                                         {
                                             post.Title,
                                             post.Body
                                         }),
                                DatePosted = post.Date
                            };
  
          Index(x =&gt; x.Query, FieldIndexing.Analyzed);            
      }
  
      public class Result
      {
          public object[] Query { get; set; }
          public DateTime DatePosted { get; set; }
      }
  }
  </code></pre>
  
  <p>and have method:</p>
  
  <pre><code>public List&lt;Post&gt; Filter(string freeSearch)
  {
      IQueryable&lt;Post&gt; posts;
      var posts = documentSession
              .Query&lt;FreeSearchIndex.Result, FreeSearchIndex&gt;()
              .Where(x =&gt; x.Query == (object)freeSearch)
              .OrderByDescending(x =&gt; x.DatePosted)
              .As&lt;Post&gt;();                                 
  
      return posts.ToList();
  }
  </code></pre>
  
  <p>and have unit test:</p>
  
  <pre><code>[SetUp]
  public void Setup()
  {
      store = new EmbeddableDocumentStore
                  {
                      RunInMemory = true
                  };
  
      store.Initialize();
  
      session = store.OpenSession();
  
      IndexCreation.CreateIndexes(typeof(FreeSearchIndex).Assembly, store);
  }
  
  [Test]
  public void GivenFreeSearchPhrase_Filter_ShouldOutputFilteredPostsByGivenPhrase()
  {            
      session.Store(new Post { Body = "universal answer to everything is 42" });
      session.SaveChanges();
  
      var posts = Filter("everything");
  
      Assert.AreEqual(1, posts.Count);            
  }
  </code></pre>
  
  <p>And it fails, because query returns 0 posts. How do I troubleshoot this? Should I check generated query, is it possible to check how it indexed fields in store (which is in memory)?</p>