Solr Indexing And The Unique Key Field
If you encounter problems with Solr indexing and inconsistencies in the actual indexing - you might have a problem with the Solr unique key field.
If you index items that may have the same id, and this id is used as the unique key in Solr - then you have a problem. Items with the same id's will simply not be tolerated in the Solr index, thus the latter item overwrites the former when indexing. Of course, this is a default and correct behaviour from Solr.
However - this is easy to solve. You just have to use the UUID (Universal Unique Identifier) field type in Solr.
In schema.config in your Solr conf folder (normally C:/solr/conf or similar), add the UUID type, like this:
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
Then, add a field of this type (still in schema.config):
<field name="uid" type="uuid" indexed="true" stored="true"
default="NEW" />
Finally, make sure to point out this field as the unique key, in schema.config:
<uniqueKey>uid</uniqueKey>
All done! Now all your indexed items will have a unique ID.
Here's more documentation on Solr and the UniqueKey field.