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

Using cfsearch vs database query

Guest
Nov 19, 2011 Nov 19, 2011

Hi,

I am looking into building a product search tool for our e-commerce site and I am looking into using coldfusion's solr search engine.  However, I haven't figure out a way to rank search results based on the products popularity.  For instance, if someone searches for 'widget', I would like to return 'red widget', 'green widget', 'blue widget' - in order of their popularity.  Is this possible to do?

Or should I just use cfquery?  This would be very simple to do in cfquery, especially since I only need to index product titles and skus.  What are the advantages of using search engine vs using query in my case?

Thanks!

595
Translate
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
Contributor ,
Nov 19, 2011 Nov 19, 2011
LATEST

In your case, I would strongly suggest sticking with CFQUERY: simple

LIKE clauses to test the search key against whichever columns you want

to search on. If you need to factor in popularity, then the query could

just ORDER BY a computed column of "number of times viewed" or "number

of units ordered" or whatever metric you have available.

Solr's good for indexing large blocks of content: let the database

search columns of data.

Translate
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