In a previous post I talked about using structs to avoid using CFQUERY inside a query loop. Structs are also useful if you need to return your data in JSON format (of course, ColdFusion can return query objects in JSON format as well, but I think this format can be difficult to use if you’re using something other than ColdFusion to read it back in). In this vein, it would be helpful if structs retained sort order. This helpful blog post shows how to do just that.
Archive for January, 2012
ColdFusion 9: Preserving sort order with structs
Posted by David Faber on January 28, 2012
Posted in ColdFusion | Tagged: ColdFusion, JSON, linkedHashMap, struct | Leave a Comment »
ColdFusion 9 and Solr: MultiValued fields vs. Tokenized
Posted by David Faber on January 17, 2012
I was indexing a new collection yesterday and kept getting out of memory errors from the JVM (in truth, I don’t know if they were from JRun or from whatever JVM Solr was running in). Apparently either CF didn’t like the huge array I was generating, or Solr didn’t like me trying to cram it into a multiValued field of type slong. I decided to try something different – I created a space-delimited list of terms instead (they were all numbers, so no need to worry about phrases or anything like that). That worked great.
According to this question/answer thread on StackOverflow, there should not be a difference in results if that field is used for filtering. There may be a difference in scoring, but as I was only using the field for filtering anyway, that is not a concern.
Posted in ColdFusion, Solr | Tagged: ColdFusion, integration, JVM, Solr | Leave a Comment »
