Hi Roshan,
You only will have the contents in a field if you add it.
Ex.:
doc.add(Field.Text("contents", "My text"));
"contents" is not a default name.
William.
>From: "ROSHAN NAVENDRA" <[EMAIL PROTECTED]>
>Reply-To: "Lucene Users List" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject:
Hi,
Your adding the Field.Text(String, Reader) which does not store the field
contents. See API docs.
Either use
doc.add(Field.Text(String,String)) or
doc.add(new Field(String, String true, true, true))
To store, index and tokenize
Hope this helps
--Peter
On 3/13/02 10:54 PM, "ROSHAN NAVEN
[EMAIL PROTECTED]
> Subject: Re: Accessing the "contents" field
>
> Sunnetha,
>
> this is my Search code... I have tried the get("body") call but it returns
> a Null. thus i cannot actually process document contents.. I need
> to do this to extr
Sunnetha,
this is my Search code... I have tried the get("body") call but it returns a Null.
thus i cannot actually process document contents.. I need to do this to extract
data such as document titles etc
currently it uses get("path") to get the documents path but if I were to change
Hi Roshan,
U've got to get the contents as
doc(i).get("body")
The field name has to match what is queried back .
Suneetha.
NAVENDRA wrote:
> It is being added as a Text field which is stored i gather. Is is also being
>added as as a Reader..
It is being added as a Text field which is stored i gather. Is is also being added
as as a Reader this might be the problem I am not sure.
Here is my code, can anybody please help me.
import org.apache.lucene.analysis.SimpleAnalyzer;
import org.apache.lucene.index.IndexWriter;
import or
Make sure that you added it to the index as a stored field, and not
just indexed. Look at the Javadoc for Field class to see different
field types.
Otis
--- ROSHAN NAVENDRA <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to access the contents field of a document, fo rexample
>
> doc(i).get