0

I'm looking to create a search facility for a site, and i'd like the search to return results from the database and from files. Is this possible?

So if i search for say 'Apple' it will return database records containing Apple, as well as any files containing Apple

I've looked into cfsearch, but is it possible to create search collections that contain both data from a database and from file? It seems to be one or the other.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
luke
  • 415
  • 1
  • 4
  • 14
  • 1
    Those should always be separate searches, but there's nothing that says you can't return the first X results from both on the same page. Just output a section of DB results, then the file search results. – Adrian J. Moreno Oct 01 '14 at 22:27
  • Thanks for your comment. Why 'should' be they always be separate searches? Because thats the way ColdFusion works it? I'm thinking from a users point of view, you search the site for 'Apple', you can just want the best results for Apple, be they on a page ( from the database ) or a file linked on a page? – luke Oct 01 '14 at 22:40
  • The users don't see the code that executes. They probably see a form for their search parameters and the results of the search. How the results get generated is not their concern, it's yours. By the way, the fact that you would have to do two searches has nothing to do with ColdFusion. It would be the same with java, php, .net, etc. – Dan Bracuk Oct 02 '14 at 00:14
  • 1
    Yes, it is possible to index data from a database as well as the content of files using `cfindex` and have mixed results returned when you do a `cfsearch`. The question I have is...did you try to do it? If not, why not? – Scott Stroz Oct 02 '14 at 03:12
  • Thanks for the comments. Scott, you're right - you can have a collection with data from files and results from a query :) – luke Oct 04 '14 at 16:54

0 Answers0