You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by acsnaterse <as...@hotmail.com> on 2007/03/19 09:11:00 UTC

Error: doc counts differ from segment_qsl

Hi,

I have a Lucene implementation which works good (I thought), but after a day
(or few days) I don't get search results anymore and in the logs i see this
error:

doc counts differ for segment _qsl: fieldsReader shows 10 but segmentInfo
shows 100

But I've done noting with the index. does anyone knows what this error means
and how I can solve this?

My code:
Analyzer analyzer = new StandardAnalyzer();
Hits hits = null;

IndexReader ireader = IndexReader.open(indexDirectory);
IndexSearcher isearcher = new IndexSearcher(ireader);
QueryParser parser = new QueryParser("CONTENT", analyzer);
parser.setDefaultOperator(QueryParser.AND_OPERATOR);
Query query = parser.parse(searchString);

hits = isearcher.search(query);

for(int i=0; i<hits.length(); i++) {
    Document hitDoc = hits.doc(i);
    float score = hits.score(i);

    String title = hitDoc.getField("TITLE") != null ?
hitDoc.getField("TITLE").stringValue() : "";
    String content = hitDoc.getField("CONTENT") != null ?
hitDoc.getField("CONTENT").stringValue() : "";

    out.print("[" + score + "] " + title + "<br>" + content)
}
-- 
View this message in context: http://www.nabble.com/Error%3A-doc-counts-differ-from-segment_qsl-tf3425568.html#a9547838
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


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