Hi,

  Is there a way I can retrieve the value of a field that is not stored in the 
Index?


private static void indexFile(IndexWriter writer, File f)
    throws IOException {

    if (f.isHidden() || !f.exists() || !f.canRead()) {
      return;
    }

    System.out.println("Indexing " + f.getCanonicalPath());

    Document doc = new Document();

    // add contents of file
    FileReader fr = new FileReader(f);
    
    doc.add(new Field("contents", fr));

    //adding second field which contains the path of the file
    doc.add(new Field("path", f.getCanonicalPath(),
                Field.Store.NO,
                Field.Index.NOT_ANALYZED));
}

Is there a way I can access the value of the field "path" from the document 
hits?

Thanks,
a



      

Reply via email to