Search Smith

ColdFusion, SQL queries, and, of course, searching

Posts Tagged ‘cfsearch’

ColdFusion 10 and Solr range queries

Posted by David Faber on February 20, 2012

I have not yet had a chance to install the ColdFusion 10 beta and try the new and improved CFSEARCH tag. However, this morning when looking at the Solr enhancements page for CF 10, under “Storing your custom data” I noticed the following:

Consider the following code:

<cfsearch criteria='some_criteria and column_i: [ 10 - 20 ]'...>

Here, some_criteria indicates filtering. For example column_i: [ 10 - 20 ] means search all items whose values are between 10 and 20. column_i is the custom field provided by user while indexing.

If this is truly the case, then ColdFusion is tweaking the query text before sending to Solr as Solr uses the “TO” keyword in range queries. Using a hyphen does not work in queries to the Solr web service.

Believe it or not, ColdFusion 9 does seem to include support for range queries – at least, it will not return an error when you attempt a range query on a CF-approved™ field such as custom1, custom2, etc. (I say “seems” because I’ve not been able to get CFSEARCH to return any actual data using such a query.) However, using a hyphen instead of the “TO” keyword causes an error and that error comes from Solr rather than directly from ColdFusion. So it appears that as of version 9 at least, ColdFusion does not replace the hyphen in range queries with the relevant Solr operator.

Posted in ColdFusion, Solr | Tagged: , , , , | Leave a Comment »

ColdFusion 10 now in public beta

Posted by David Faber on February 17, 2012

Good news courtesy of Adobe’s ColdFusion blog.

Of particular interest to readers of Search Smith might be the Solr enhancements in ColdFusion 10. The CFSEARCH tag will now support custom fields above and beyond custom1, custom2, etc., and will also have an orderBy attribute for sorting. I take this to mean that not only has Adobe extended the capabilities of the CFSEARCH tag but also removed the comments around the custom field definitions in the default ColdFusion schema.xml file. What is not clear is whether one can search the contents of those custom fields automatically (i.e., without specifying the field name in the query). There are also some limitations.

The Data Import Handler for indexing data from a database also looks interesting.

Posted in ColdFusion, Solr | Tagged: , , , , , | Leave a Comment »

Departing from the confines of CFSEARCH

Posted by David Faber on January 11, 2012

Here are the beginnings of a series of blog posts on using Apache Solr with ColdFusion:

Unfortunately, it doesn’t look like the author has made any further posts on the topic. However, the first post, Departing from the confines of cfsearch, may be helpful in showing how Solr can be used on multiple platforms (ColdFusion, Railo, BlueDragon); while the second post, Installing Solr with Tomcat, may be helpful for those who want to set up a Solr server independently of ColdFusion.

Posted in ColdFusion, Solr | Tagged: , , , | Leave a Comment »