Hi, thats interesting. if you do a Field.Text(String name, Reader value) it should be indexed but not stored. strange i had no problems, but i didnt use a stringreader, just file readers.
try to do create your customized field, passing a string that is not stored. i dont remember the documentation exactly, but this should be possible passing the right parameters to the field constructor. regards joe "Robert A. Decker" <[EMAIL PROTECTED]> writes on Thu, 28 Mar 2002 00:22:36 +0100 (MET): > 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, > isCreateNewIndex); > writer.addDocument(document); > writer.close(); > > > rob > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>