Copy link to clipboard
Copied
The documentation does not list fieldBoost in the list of valid attributes to cfindex, yet further down the page its function is described (see https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfindex.html ). It does not seem to have any effect on the cfindex tag. Has fieldBoost been removed (and how can we then boost a particular field) or has the syntax changed (and to what)? This is a ColdFusion 2018 Standard Edition running on Win Server 2016.
Best, Robert
Copy link to clipboard
Copied
Are you using
<cfindex fieldBoost="title">
or
<cfindex fieldBoost="title:3"> ?
The usual recommendation is to use the second, which includes a weighting factor (3).
Copy link to clipboard
Copied
Thank you so much for your answer, I have indeed tried both, but it does not seem to have any effect on the results returned. For instance: first I index without any fieldboost, and a search for "tax" returns this document with "tax" in the title. Then I reindex with "fieldboost:100" and expect the score to be higher, but it is unchanged. Is there perhaps any range limit for the boost value?
Copy link to clipboard
Copied
Correction: I re-index with fieldBoost="title:100"
Copy link to clipboard
Copied
fieldBoost="fieldName:100" is the syntax everyone seems to be using. I have never used fieldBoost myself. Having searched exhaustively on the web, I found no official ColdFusion documentation on its usage.
After looking at Solr websites I now begin to wonder whether the syntax ColdFusion developers have been using is wrong.
Take the documentation on solr.apache.org, for example. Suppose you have an index containing the field, title. You wish to find a document with "Tax Returns" in the title, but you want "Tax" to be more relevant.
Then you can boost the term "Tax". You do this by means of the caret symbol ^ followed by a boost factor (a number). Hence,
FieldBoost="Tax^6 Returns"
I am curious whether this will work. Let us know after you try.
In answer to your question about size-limit, I think there is no limit to how large the boost number can be. It is a relative factor, with default value 1. So "Tax^6 Returns" means that "Tax" will be 6 times more relevant in the search than "Returns".
Copy link to clipboard
Copied
The official documentation surely is sparse to put it mildly. What you suggest looks like something you would do when searching rather than when indexing. My case is, I am indexing a database, there is a column "keywords" and I want entries to get a boost for the terms in the "keywords" column. In any case the fieldBoost="keyword^6" throws a syntax error, only the version with the comma is accepted. I am beginning to think the fieldboost only works for the Data Import Handler as described here: https://helpx.adobe.com/coldfusion/developing-applications/accessing-and-using-data/solr-search-supp... I am using the old method (querying the database, then indexing the query).
Copy link to clipboard
Copied
Thanks for sharing that. So, to confirm, the notation for boosting when indexing is indeed fieldboost="first_t:1,second_t:2".