lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ambiese...@gmx.de
Subject Retrieving the content from hits...
Date Mon, 05 Jan 2004 16:27:09 GMT
Hi Group,

I have a little problem which is able of being solved easily from the
expertise within this group. 

A index has beein generated. The document used looks like this:

Document doc = new Document();
doc.add(Field.Text("contents", new FileReader(file)));
doc.add(Field.Keyword("filename", file.getCanonicalPath())); 


When I now search, I get a correct hit. However it seems the "contents"
field does not exist. When I get the field, only "filename" exists...

Here some code how I parse the hits object:

Document d = hits.doc(0);
Enumeration enum = d.fields();
while (enum.hasMoreElements()){
  Field f = (Field)enum.nextElement();
  System.out.println("Field value = " + f.stringValue()); 
}

Where is the problem? 

Ralf


-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message