You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by David Seltzer <ds...@TVEyes.com> on 2009/04/02 16:45:24 UTC
Retrieving TokenStream from Tokenized Non-Stored Field
Hi All,
I have a document with a field called "TextTranscript". Its created
using the following command:
myDoc.add(new Field("TextTranscript", sTranscriptBody, Field.Store.NO,
Field.Index.TOKENIZED));
I'm then trying to retrieve the TokenStream by pulling the field.
Field fTextTranscript = lucDoc.getField("TextTranscript");
But fTextTranscript seems always to be NULL. My understanding is that I
should be able to retrieve the TokenString, even if it's not "Stored".
Am I incorrect? Is there a better way of doing this?
Thanks!
-Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Retrieving TokenStream from Tokenized Non-Stored Field
Posted by David Seltzer <ds...@TVEyes.com>.
Ah, ok. Well that explains the behavior then. Thanks!
-----Original Message-----
From: Michael McCandless [mailto:lucene@mikemccandless.com]
Sent: Thursday, April 02, 2009 4:14 PM
To: java-user@lucene.apache.org
Subject: Re: Retrieving TokenStream from Tokenized Non-Stored Field
Actually you have to mark the field as Field.Store.YES in order to see
that field when you retrieve the doc at search time.
You'll then be able to retrieve the string value.
Mike
On Thu, Apr 2, 2009 at 10:45 AM, David Seltzer <ds...@tveyes.com> wrote:
> Hi All,
> I have a document with a field called "TextTranscript". Its created
> using the following command:
>
> myDoc.add(new Field("TextTranscript", sTranscriptBody, Field.Store.NO,
> Field.Index.TOKENIZED));
>
> I'm then trying to retrieve the TokenStream by pulling the field.
>
> Field fTextTranscript = lucDoc.getField("TextTranscript");
>
> But fTextTranscript seems always to be NULL. My understanding is that I
> should be able to retrieve the TokenString, even if it's not "Stored".
> Am I incorrect? Is there a better way of doing this?
>
> Thanks!
>
> -Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Retrieving TokenStream from Tokenized Non-Stored Field
Posted by Michael McCandless <lu...@mikemccandless.com>.
Actually you have to mark the field as Field.Store.YES in order to see
that field when you retrieve the doc at search time.
You'll then be able to retrieve the string value.
Mike
On Thu, Apr 2, 2009 at 10:45 AM, David Seltzer <ds...@tveyes.com> wrote:
> Hi All,
> I have a document with a field called "TextTranscript". Its created
> using the following command:
>
> myDoc.add(new Field("TextTranscript", sTranscriptBody, Field.Store.NO,
> Field.Index.TOKENIZED));
>
> I'm then trying to retrieve the TokenStream by pulling the field.
>
> Field fTextTranscript = lucDoc.getField("TextTranscript");
>
> But fTextTranscript seems always to be NULL. My understanding is that I
> should be able to retrieve the TokenString, even if it's not "Stored".
> Am I incorrect? Is there a better way of doing this?
>
> Thanks!
>
> -Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org