title: Can't get search result while using filepath as a search field - Lucene.NET 2.9
body: <p>My goal is to index the PATH of the files so I can search afterwards.
  I have the following code:</p>
  
  <pre><code> class Program
  {
      static void Main(string[] args)
      {
          Directory directory = FSDirectory.Open(new DirectoryInfo("LuceneIndex"));
          Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_29);
          var writer = new IndexWriter(directory, analyzer, IndexWriter.MaxFieldLength.UNLIMITED);
          writer.Optimize();
          writer.Commit();
          writer.Close();
          String text1 = "C:\\Users\\Marto\\Desktop\\folder1\\file1.txt";
          WriteDocument(text1);
          SearchSomething("C:\\Users\\Marto\\Desktop\\folder1\\file1.txt");
          Console.ReadLine();
      }
  
      private static void WriteDocument(String text)
      {
          Directory directory = FSDirectory.Open(new DirectoryInfo("LuceneIndex"));
          string[] DEFAULT_STOP_WORDS = { };
          Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_29, DEFAULT_STOP_WORDS);
          var writer = new IndexWriter(directory, analyzer, IndexWriter.MaxFieldLength.UNLIMITED);
          var doc = new Document();
          doc.Add(new Field("path", text, Field.Store.YES, Field.Index.NOT_ANALYZED));//text = "C:\\Users\\Marto\\Desktop\\folder1\\file1.txt"
          writer.AddDocument(doc);
          writer.Optimize();
          writer.Commit();
          writer.Close();
      }
  
      private static void SearchSomething(String searchText)
      {
          Directory directory = FSDirectory.Open(new DirectoryInfo("LuceneIndex"));
          string[] DEFAULT_STOP_WORDS = { };
          Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_29, DEFAULT_STOP_WORDS);
          var parser = new QueryParser(Version.LUCENE_29, "path", analyzer);
          Query query = parser.Parse(searchText);
          //searchText = "C:\\Users\\Marto\\Desktop\\folder1\\file1.txt"
          //but query = {C:usersmartodesktopfolder1file1.txt}
          var searcher = new IndexSearcher(directory, true);
          TopDocs topDocs = searcher.Search(query, 500);
          int results = topDocs.ScoreDocs.Length;
          Console.WriteLine("Found {0} results", results);
          for (int i = 0; i &lt; results; i++)
          {
              ScoreDoc scoreDoc = topDocs.ScoreDocs[i];
              float score = scoreDoc.Score;
              int docId = scoreDoc.Doc;
              Document doc = searcher.Doc(docId);
              Console.WriteLine("Result num {0}, score {1}", i + 1, score);
              Console.WriteLine("Text found: {0}\r\n", doc.Get("path"));
          }
          searcher.Close();
          directory.Close();
      }
  
  }
  </code></pre>
  
  <p>But when i search for "C:\Users\Marto\Desktop\folder1\file1.txt", the query remove the characters \ and don't return any result.</p>
  
  <p>I also try with other Analyzer but I get the same result.
  If any could help me, i will we very gratefull!!!</p>