Two quicks things I can think of: - make sure that 'fieldToSearch' == "allText" - make sure writer is closed after all docs added and then open the reader/searcher
Otherwise, can you provide more info: - at least one example where it "doesn't work": - 'searchText' - the text of the field added to the document, that should be returned by the query but is not. - 'search' - the query text, for the query that should find that document, but does not. - which analyzer is used at search - which analyzer used at indexing djd0383 <[EMAIL PROTECTED]> wrote on 29/09/2006 10:28:18: > > I am in the process of trying to upgrade to v2.0 from v1.4 and am having > trouble building my index. For each of the various entries in the database, > I am more or less doing the following: > > doc1.add(new Field("allText",searchText,Store.NO,Index.TOKENIZED)); > indexWriter.add(doc1); > > This seems to build an incorrect index. I know this is true because I can > see entries that are not indexed. The searching and indexing have been > minorly editted from the v1.4 code and seem to be correct. > > My query is like the following if this helps too: > > final Query query; > QueryParser qp = new QueryParser(fieldToSearch,analyzer); > query = qp.parse(search); > > Thanks for your help. > -- > View this message in context: http://www.nabble.com/Upgrading-1.4- > to-2.0---Indexing-Issue.-tf2358182.html#a6569399 > Sent from the Lucene - Java Developer mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]