Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top