lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert A. Decker" <>
Subject Field.Text arguments
Date Wed, 27 Mar 2002 23:22:36 GMT
I'm confused about using Fields.

Here's the two methods that are confusing me:
public static final Field Text(String name, Reader value)
public static final Field Text(String name, String value)

The difference is that one takes a reader and the other a string.

I have a field that will have pretty large contents after running through
my analyzer (1500 to 6000 characters).

When I use the second of the two methods above my string is not run
through the analyzer, but is stored in the index.

When I use the first method, by passing in a StringReader based of the
String, I don't get anything indexed at all (and therefore it's difficult
to know if it was analyzed).

Is there some other Field type that I should be using for text that I want
analyzed and indexed, and that the text can be fairly long?

Here's a rough order of I'm doing things. FragmentAnalyzer is my own
custom class that seems to normally work:

Document document = new Document();
Reader reader = new StringReader(text);
document.add(Field.Text("contents", reader));
FragmentAnalyzer analyzer = new FragmentAnalyzer();
IndexWriter writer = new IndexWriter(pathToIndex, analyzer,


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message