1

I read in the CF10 docs that the attribute 'FieldBoost' has been added to CFIndex in order to specify which fields should have more importance in Solr's scoring.

However, it seems that not only does it not work as intended, it in fact causes the whole indexing operation to fail completely! I've seen other posts on the Adobe forums mentioning exactly the same issue, but no replies or resolution available.

I'm running CF10 Update 11.

The following code works and indexes 14,000 records:

        <cfindex collection = "MyCollection" 
        action          = "refresh"
        type            = "custom"
        query           = "Local.MyContent" 
        key             = "ID"
        title           = "Name"
        body            = "Name,Description"
    >

However, if I add the FieldBoost value, there are no errors and the index operation appears to run correctly, however the collection now contains zero records:

        <cfindex collection = "MyCollection" 
        action          = "refresh"
        type            = "custom"
        query           = "Local.MyContent"  
        key             = "itemID"
        title           = "Name"
        body            = "Name,Description"
        fieldBoost      = "title"
    >

Has anyone had this working?

Gary Stanton
  • 1,435
  • 12
  • 28
  • Should the value be `title` or `Name` ? – Peter Boughton Jul 31 '13 at 17:03
  • 1
    See this related post - [CF10 Fieldboost on cfindex has no effect](http://stackoverflow.com/questions/12589084/cf10-fieldboost-on-cfindex-has-no-effect) – Miguel-F Jul 31 '13 at 18:09
  • @PeterBoughton I've tried both to no avail! – Gary Stanton Aug 01 '13 at 09:43
  • @Miguel-F I've looked at that post and I can indeed start playing with weighting at the point of search, however it's less than ideal. When I'm weighting the query like that, I'm messing with custom fields which are limited in the way they can be searched - Wildcards are not allowed at the beginning of the criteria, and although title doesn't seem to, other custom fields require exact matching. Title is case sensitive too! I feel that my use case would be much better served if I could get fieldBoost working as described - is it possible this is a bug in ACF? – Gary Stanton Aug 01 '13 at 09:46
  • What I'm looking for is the same kind of search functionality I get by searching the body, but with the contents in certain fields being more important than others... Is this not how it's supposed to work? – Gary Stanton Aug 01 '13 at 09:47
  • 1
    I did find [this bug](https://bugbase.adobe.com/index.cfm?event=bug&id=3350009) which begs the question; have you tried including the weight within the fieldboost attribute? Should be something like this `fieldboost="title:8"` or `fieldboost="Name:8"`? Still not sure whether you should specify `title` or `Name`. – Miguel-F Aug 01 '13 at 12:04
  • Aha! I didn't see anything in the docs that indicated I'd need to include the weight in there... It seems to work, although I'm not convinced it works particularly *well*! It does at least index and I get better, though not perfect results. Thanks for looking into it for me. – Gary Stanton Aug 01 '13 at 15:38

1 Answers1

3

From the comments...

I found this bug which I believe is similar to your situation (although it was reported on a Mac platform).

Although it is not documented very well you need to include the weight with the fieldboost attribute. For ColdFusion's implementation you specify the weight by appending it to the field you want boosted delimited with a : (colon). The attribute should look something like this:

fieldboost="title:6" 

I was able to find a little bit of documentation on this attribute in the Adobe ColdFusion 10 Beta documentation (on page 106 of that document specifically). Here is an excerpt from that document:

Improving search result rankings
The following attributes in cfindex help you improve the search result rankings:

  • fieldBoost: Boost specific fields while indexing.
    fieldBoost enhances the score of the fields and thereby the ranking in the search results. Multiple fields can be boosted by specifying the values as a comma-separated list.

  • docBoost: Boost entire document while indexing.
    docBoost enhances the score of the documents and thereby the ranking in the search results

And the following code is the example they used to show the fieldboost attribute (notice that they are boosting two fields, separated by a comma):

<cfindex collection="autocommit_check" action="update" type="file" key="#Expandpath(".")#/_boost1.txt" first_t="fieldboost" second_t="secondfield" fieldboost="first_t:1,second_t:2" docboost="6" autocommit="true">

Also check this related question for a way to boost fields during the search - CF10 Fieldboost on cfindex has no effect

Community
  • 1
  • 1
Miguel-F
  • 13,450
  • 6
  • 38
  • 63