SENTHIL SARAVANAN
SENTHIL SARAVANAN

Reputation: 749

Solr: Incorrect numFound value

I have try to add MySQL database to solr index. After finishing dataimport process, it show "1428760" documents are updated. But solr full search query show numFound="546195".

What is the problem? Why this mismatch?

Upvotes: 0

Views: 2835

Answers (2)

Dmitry Negoda
Dmitry Negoda

Reputation: 3189

Check here:

http://lucene.472066.n3.nabble.com/Changing-value-of-start-parameter-affects-numFound-td2460645.html

Some guy says something about duplicate documents in solr. Looks like you should explicitly remove the document before reindexing it.

Upvotes: 1

Nick Zadrozny
Nick Zadrozny

Reputation: 7944

I'm guessing the 1,428,760 comes from somewhere authoritative like the admin panel or CoreAdmin API, and the 546,195 is the number of matches against a wildcard search.

Check your headers. Is there a partialResults flag set to true? If so, then Solr hit its internal timeAllowed timeout when scanning through the index, and has only returned a partial set of all the matching documents.

This is one feature which demonstrate's Solr's preference for performance. It attempts to give you the most relevant results to your queries as quickly as possible. When a lot of documents match a query, it assumes that it can save some time and return quickly without impacting relevancy too much. Because who's going to paginate through half a million hits?

Anyway, without more details, this is just a guess and a brief explanation of partialResults.

Upvotes: 1

Related Questions