Copy link to clipboard
Copied
Hello, everyone.
I'm trying to search more than one Solr collection for a keyword (let's say "Item A"), but I want to remove any duplicates and keep the ranking.
Hypothetically, let's say each collection has "Item A" in it, each ranked slightly different in their respective collection (99.9, 92.7, and 89.5). How would I remove the two lower ranked "Item A"'s from the CFSEARCH?
Thank you,
^_^
Copy link to clipboard
Copied
I think I've got it.
For anyone else who has this same need, try QoQ.
<cfsearch name="cfSolrSearch" collection="collectionOne,collectionTwo,collectionThree" criteria="Item A">
<cfquery name="removeDupes" dbtype="query">
SELECT DISTINCT title, cast(score as decimal) as score
FROM cfSolrSearch
ORDER BY score DESC
</cfquery>
<cfdump var="#removeDupes#">
^_^
PS. In the first post, I mentioned "rank"; I meant "score".