Skip to main content
November 19, 2011
Question

Using cfsearch vs database query

  • November 19, 2011
  • 1 reply
  • 621 views

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!

This topic has been closed for replies.

1 reply

Participating Frequently
November 19, 2011

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.