Deleted documents remain in the Lucene index until an "optimize" or segment merge operation removes them. As a result they are still counted in document frequency. An update is a combination of a delete and an add of a fresh document.

-- Jack Krupansky

-----Original Message----- From: Johannes Siegert
Sent: Tuesday, July 22, 2014 7:26 AM
To: solr-user@lucene.apache.org
Subject: wrong docFreq while executing query based on uniqueKey-field

Hi.

My solr-index (version=4.7.2.) has an id-field:

<field  name="id"  type="string"  indexed="true"  stored="true"/>
...
<uniqueKey>id</uniqueKey>

The index will be updated once per hour.

I use the following query to retrieve some documents:

"q=id:2^2 id:1^1"

I would expect that the document(2) should be always before the
document(1). But after many index updates document(1) is before document(2).

With debug=true I could see the problem. The document(1) has a
docFreq=2, while the document(2) has a docFreq=1.

How could the docFreq of the uniqueKey-field be hight than 1? Could
anyone explain this behavior to me?

Thanks!

Johannes

Reply via email to