• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF9 - multiple Solr collections search, remove dupes

LEGEND ,
Jan 04, 2013 Jan 04, 2013

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,

^_^

Views

412

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2013 Jan 04, 2013

Copy link to clipboard

Copied

LATEST

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".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation