Skip to main content
October 17, 2009
Answered

CF9/Solr: cfindex custom fields limitation

  • October 17, 2009
  • 1 reply
  • 1416 views

On CF9, using Solr, I'm trying to index a database query, but, like Verity in this and previous versions of CF, there is a limitation on the number of custom fields I can index.  I know the limitation lies with the cfindex tag as Solr is able to index whatever fields are specified in schema.xml.

One workaround I have in mind is to modify the schema.xml file by adding all the custom fields I need and then index my content using Solr (post.jar?) instead of cfindex.  The cfsearch tag should then return all the new fields, not just the 4 custom ones.  Has anyone tried to do this?  What command do I need to invoke to index the content directly through Solr?

Or, does anyone else have any other workaround suggestions?

Thanks,

-Jose

    This topic has been closed for replies.
    Correct answer Adam Cameron.

    Depending on your requirements, you might be over-complicating things.  Just because <cfindex> only offers CUSTOM1...CUSTOM4 doesn't mean you must only have one subkey value per CUSTOMn attribute.  You can put anything you like in those values, eg: lists of subkeys; serialised structs or keys, etc.

    I agree that it's less than ideal the way the Solr support has been implemented, but you probably will be able to get <cfindex> to work for you in this case.

    --

    Adam

    1 reply

    Adam Cameron.Correct answer
    Inspiring
    October 17, 2009

    Depending on your requirements, you might be over-complicating things.  Just because <cfindex> only offers CUSTOM1...CUSTOM4 doesn't mean you must only have one subkey value per CUSTOMn attribute.  You can put anything you like in those values, eg: lists of subkeys; serialised structs or keys, etc.

    I agree that it's less than ideal the way the Solr support has been implemented, but you probably will be able to get <cfindex> to work for you in this case.

    --

    Adam

    October 19, 2009

    Adam,

    You are correct.  A serialized struct addresses my needs perfectly.  This probably didn't occur to me as I don't often use CFWDDX, but it's a great solution.

    Thank you!

    -Jose