I just find out that my Solr index doesn't contain a _id field. and it is not possible to get item id. UniqueId is present but this is not really useful.
public class MyClass
{
[IndexField(BuiltinFields.UniqueId)]
public string UniqueId { get; set; }
[IndexField(BuiltinFields.ID)]
public int Id { get; set; }
}
How to add item id to Solr index ? What should I add to schema.xml ? Is next string would be enough ?
<field name="_id" type="string" indexed="true" stored="true" required="true" />
If yes why Sitecore doesn't include it during build schema.xml file for Solr ?
It seems that it could be an issue with duplication records in search result that I have as well :)