0

Maybe this is a new, mostly unused feature, but I am trying to create a collection based on a query from our DB. It's a simple Q&A and I'd like to rank the matches in the question higher than the answer. Seems logical as currently a search for "register for classes" the question "How do I register for classes" ranks lower than "How to I purchase books for my classes" because content in the books answers I guess matches better. So I'd like to bump the Q&A's if the question matches really well to the text in the query.

CF10 has a "Fieldboost" field on the cfindex however this is having 0 effect on results. I add it and remove it and nothing changes. The score and rank stays the exact same.

<cfindex action="refresh" collection="faq" 
      type="custom" 
      title="question" 
      body="question,answer" 
      fieldboost="question:6" 
      key="faq_id" 
      query="updateQuery" 
      location_i="location_id" />

`

Leigh
  • 28,765
  • 10
  • 55
  • 103
Leeish
  • 5,203
  • 2
  • 17
  • 45
  • As you mentioned, I am not very familiar with this feature. I'm curious why you have the colon 6 in your attribute `fieldboost="question:6"` though. Do you have a field named like that? – Miguel-F Sep 25 '12 at 18:58
  • Never mind, I found it in some examples. Looks like a weight. – Miguel-F Sep 25 '12 at 19:07
  • Correct. I believe it equates to the Solr question^6 in other documentation. Added weight. It is strange how little documentation/forums topics on this considering how old CF10 is. – Leeish Sep 25 '12 at 20:29
  • CF10 isn't old - it is the last release. :) – Raymond Camden Sep 26 '12 at 10:52
  • I know it's not old, but it has been out for a bit. And considering this simple thing isn't working for me out of the box, I would imagine others would be having problems as well. – Leeish Sep 26 '12 at 14:29
  • Agreed. I'm going to try to recreate this. If you don't hear back from me here, you mind contacting me directly at raymondcamden.com? I can reach out to one of the engineers. – Raymond Camden Sep 26 '12 at 19:54
  • I'd love to know if you get fieldboost to have any effect on search results. – Leeish Sep 26 '12 at 23:16

2 Answers2

0

So I searched Raymond Camden's site and found a little answer that I thought I had tried earlier, but maybe my syntax was wrong. I am using title:#URL.q#^2 which is working to boost the value of title in the search.

While this works, the CF10 docs indicate I should be able to do this with the fieldboost property, which I still cannot get to work.

Leigh
  • 28,765
  • 10
  • 55
  • 103
Leeish
  • 5,203
  • 2
  • 17
  • 45
0

According to the Solr documentation any field that is to be boosted must have omitNorms="false" in schema.xml. The default is false but is it possible it is being set to true in your schema.xml? The other issue I see in the above CFINDEX statement is that you're not specifying a field name in your fieldboost parameter, but rather a query column. If you want to boost on title then perhaps you need

<cfindex ... fieldboost="title:6" ... />

?

David Faber
  • 12,277
  • 2
  • 29
  • 40