If i have 2 records into my SOLR indexing with same email address and my keyword search is getting both of them in the result set, how can i display one of them. For example;
Record 1:
<doc>
<id>123</id>
<name>Adil Malik</name>
<email>abc@hotmail.com</email>
<jobtitile>Software Engineer</jobtitle>
</doc>
Record 2:
<doc>
<id>456</id>
<name>Adil Malik</name>
<email>abc@hotmail.com</email>
<jobtitile>Database Developer</jobtitle>
</doc>
If we search with “abc@hotmail.com”, it will return both records but i want to display any one of them. How can i query in the SOLR search to display only one record if we have 2 with same email address?
NOTE: i want to keep both records into my SOLR indexing.
In reply to @Layke

You should do some reading on FieldCollapsing and also on Deduplication (Deduplication prevents documents from entering the index at all, which isn’t what you want, but I’ll keep it here to help other readers where this might be suitable. ).
To use the FieldCollapsing, you would use your query and have
group: true , group.field : emailHowever, looking at the document examples you provided, I would probably say that you have designed your schema wrong, and what you actually want to do it use Multi Values fields.
Read this question here it might explain/advise how you should have used MVF instead.
What is the use of "multiValued" field type in Solr?