Hello,
[G�nter Kukies]
> Why is document.get("contents"); null ?
> InputStreamReader input = new InputStreamReader(
> new ByteArrayInputStream( contents ) );
> // Add the tag-stripped contents as a Reader-valued Text field so it will
> // get tokenized and indexed.
> document.add(Field.Text("contents", input ));
[...]
> servlet.log("contents: "+ input +" doc: "+document.get("contents"));
document.get("contents") returns the value of the document field only if
it was inserted as String, but you add it as Reader.
Note that there is difference between Field.Text(String fieldName, Reader
value )
and Field.Text(String fieldName, String value ). Both function creates an
indexed
and tokenized field, but only the value given as string is stored in the
index
for return with hits. Field.Text(String fieldName, Reader value ) was
designed for
indexing large documents, so it makes less sense to store this value in
index and
to access it as string. I think, it is reasonable that
document.get("contents")
shows the same behaviour while creating and searching the index.
Hope that this explanation help. Regards,
Wolf-Dietrich
--
Wolf-Dietrich Materna
Development
empolis GmbH - arvato knowledge management
Kekul�str. 7
12489 Berlin, Germany
phone : +49-30-6780-6510
fax : +49-30-6780-6549
<<mailto:[EMAIL PROTECTED]>> <<http://www.empolis.com>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]