title: Searching issue using lucene.Net
body: <p>I'm trying to your the search engine of Lucene .Net. i followed some documentation on the website but i might have missed something since it doesn't work as expected ..</p>
  
  <p>Here is the code : </p>
  
  <pre><code>var stringBuilder = new StringBuilder();
          var pdfReader = new PdfReader(@"c:\Test\testRoot.pdf");
          for (var page = 1; page &lt;= pdfReader.NumberOfPages; page++)
          {
              stringBuilder.Append(PdfTextExtractor.GetTextFromPage(pdfReader, page) + " ");
          }
          if (stringBuilder.ToString().Contains("new"))
          {
              Console.WriteLine("New is present in the text!");
          }
          const string strIndexDir = @"C:\Index";
          Directory indexDir = FSDirectory.Open(strIndexDir);
          Analyzer std = new StandardAnalyzer(Version.LUCENE_29);
          var idwx = new IndexWriter(indexDir, std, true, IndexWriter.MaxFieldLength.UNLIMITED);
          var doc = new Document();            
          var fdl = new Field("testRoot", stringBuilder.ToString(), Field.Store.YES, Field.Index.ANALYZED);
          doc.Add(fdl);
          idwx.AddDocument(doc);
          idwx.Optimize();
          idwx.Dispose();
          Console.WriteLine("Indexing Done !");
  
  
          var parser = new QueryParser(Version.LUCENE_29, "new", std);
          var qry = parser.Parse(parser.Field);
          Directory directory = FSDirectory.Open(new System.IO.DirectoryInfo(strIndexDir));
          Searcher srch = new IndexSearcher(IndexReader.Open(directory, true));
          TopScoreDocCollector cllstr = TopScoreDocCollector.Create(100, true);
          ScoreDoc[] hits = cllstr.TopDocs().ScoreDocs;
          for (int i = 0; i &lt; hits.Length; i++)
          {
              int docId = hits[i].Doc;
              float score = hits[i].Score;
              Document docy = srch.Doc(docId);
              Console.WriteLine(docy.Get("text"));
          }
          Console.ReadLine();
  </code></pre>
  
  <p>The thing is That the word new is present in the text of my PDF since it goes in the 'if'.</p>
  
  <p>but at the end, when i try to look for the match, nothing's here ..</p>
  
  <p>EDIT:</p>
  
  <p>i made few changes but still doesn't work:</p>
  
  <pre><code>var stringBuilder = new StringBuilder();
          var pdfReader = new PdfReader(@"c:\Test\testRoot.pdf");
          for (var page = 1; page &lt;= pdfReader.NumberOfPages; page++)
          {
              stringBuilder.Append(PdfTextExtractor.GetTextFromPage(pdfReader, page) + " ");
          }
          if (stringBuilder.ToString().Contains("new"))
          {
              Console.WriteLine("New is present in the text!");
          }
          const string strIndexDir = @"C:\Index";
          Directory indexDir = FSDirectory.Open(strIndexDir);
          Analyzer std = new StandardAnalyzer(Version.LUCENE_29);
          var idwx = new IndexWriter(indexDir, std, true, IndexWriter.MaxFieldLength.UNLIMITED);
          var doc = new Document();            
          var fdl = new Field("testRoot", stringBuilder.ToString(), Field.Store.YES, Field.Index.ANALYZED);
          doc.Add(fdl);
          idwx.AddDocument(doc);
          idwx.Optimize();
          idwx.Commit();
          idwx.Dispose();
  
          Console.WriteLine("Indexing Done !");
          var parser = new QueryParser(Version.LUCENE_29, "", std);
          var qry = parser.Parse("new*");
          Directory directory = FSDirectory.Open(new System.IO.DirectoryInfo(strIndexDir));
          Searcher srch = new IndexSearcher(IndexReader.Open(directory, true));
          var lol = srch.Search(qry, 100);
          ScoreDoc[] hits = lol.ScoreDocs;
          for (int i = 0; i &lt; hits.Length; i++)
          {
              int docId = hits[i].Doc;
              float score = hits[i].Score;
              Document docy = srch.Doc(docId);
              Console.WriteLine(docy.Get("testRoot"));
          }
  </code></pre>
  
  <p>Thanks you for helping :)</p>