FAQ
Hello!!! My problem is that when I see the number or documents through
IndexWriter I see the number is 1 document. If I open IndexReader, the
numDocs sais there are no Documents...why???May u help me,please????

writerFS.addDocument(indexa.indexaFichero(archivo));
System.out.println(writerFS.numDocs());//there es 1 document


Directory dir=writerFS.getDirectory();
IndexReader ir= IndexReader.open(dir);
System.out.println(ir.numDocs());//there are 0 documents

Thanks a lot!!
--
View this message in context: http://www.nabble.com/IndexReader-and-numDocs-tp23076035p23076035.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

Search Discussions

  • Uwe Schindler at Apr 16, 2009 at 11:35 am
    You must close or commit first in the IndexWriter.

    -----
    Uwe Schindler
    H.-H.-Meier-Allee 63, D-28213 Bremen
    http://www.thetaphi.de
    eMail: uwe@thetaphi.de
    -----Original Message-----
    From: cbodeguilla
    Sent: Thursday, April 16, 2009 1:31 PM
    To: java-user@lucene.apache.org
    Subject: IndexReader and numDocs


    Hello!!! My problem is that when I see the number or documents through
    IndexWriter I see the number is 1 document. If I open IndexReader, the
    numDocs sais there are no Documents...why???May u help me,please????

    writerFS.addDocument(indexa.indexaFichero(archivo));
    System.out.println(writerFS.numDocs());//there es 1
    document


    Directory dir=writerFS.getDirectory();
    IndexReader ir= IndexReader.open(dir);
    System.out.println(ir.numDocs());//there are 0 documents

    Thanks a lot!!
    --
    View this message in context: http://www.nabble.com/IndexReader-and-
    numDocs-tp23076035p23076035.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedApr 16, '09 at 11:31a
activeApr 16, '09 at 11:35a
posts2
users2
websitelucene.apache.org

2 users in discussion

Cbodeguilla: 1 post Uwe Schindler: 1 post

People

Translate

site design / logo © 2022 Grokbase