lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: Can you create a Field that is a copy of another Field?
Date Fri, 27 Jun 2008 11:25:51 GMT

On Jun 27, 2008, at 12:01 AM, <Bill.Chesky@sungard.com> <Bill.Chesky@sungard.com

 > wrote:

> Hello Lucene Gurus,
>
>
>
> I'm new to Lucene so sorry if this question basic or naïve.
>
>
>
> I have a Document to which I want to add a Field named, say, "foo"  
> that is tokenized, indexed and unstored.  I am using the  
> "Field(String name, TokenStream tokenStream)" constructor to create  
> it.  The TokenStream may take a fairly long time to return all its  
> tokens.
>

Can you share some code here?  What's the reasoning behind using it  
(not saying it's wrong, just wondering what led you to it)?  Are you  
just loading it up from a file, string or something or do you have  
another reason?


>
>
> Now for querying reasons I want to add another Field named, say,  
> "bar", that is tokenized and indexed in exactly the same way as  
> "foo".  I could just pass it the same TokenStream that I used to  
> create "foo" but since it takes so long to return all its tokens, I  
> was wondering if there is a way to say, create "bar" as a copy of  
> "foo".  I looked thru the javadoc but didn't see anything.
>
>

By exactly the same, do you really mean exactly the same?  What's the  
point of that?  What are the "querying reasons"?

You may want to look at the TeeTokenFilter and the SinkTokenizer, but  
I guess I'd like to know more about what's going on before fully  
recommending anything.


>
> Is this possible in Lucene or do I just have to bite the bullet  
> build the new Field using the same TokenStream again?
>
> --
> Bill Chesky * Sr. Software Developer * SunGard * FAME Energy * 1194  
> Oak Valley Drive * Ann Arbor, MI 48103
> Tel 734-332-4405 * Fax 734-332-4440 * bill.chesky@sungard.com <mailto:bill.chesky@sungard.com

> >
> www.sungard.com/energy <blocked::http://www.sungard.com/energy>
>
>
>

--------------------------
Grant Ingersoll
http://www.lucidimagination.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ








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


Mime
View raw message