Link to home
Start Free TrialLog in
Avatar of Xbradders
Xbradders

asked on

Solr - Can't get Field Boosts to work with Date Function

In Solr, I have a date function to boost more recent records and multiply by a few custom variables.  This works fine:
{!boost b=product(.5,sum(div(max(sub(4,div(ms(NOW,releaseDate),31557600000)),0),4),.6),RatingFactor,PriorityFactor)} apples

I now want to boost a field in conjunction with my query, but the field boost (qf=title^3) does not seem to do anything with my query above.  When I remove the formula from my query and just search q=apples, then the (qf=title^3) boost DOES work.  Does anyone know why these aren't working in conjunction?  Thanks -
Avatar of James Rodgers
James Rodgers
Flag of Canada image

couple of questions

what is the field type of title?
what term are you searching? multiple words? single words? both?
Avatar of Xbradders
Xbradders

ASKER

I've tried setting the title field type as text and string but can't get the desired result.  I've tried putting my title field it in the 'text' copy field and it's own field, and also tried removing it from the 'text' copy field, thinking that it would boost more, and am having no luck.

I need to be able to search multiple terms and single words.  If an exact match is found in title, I want that record to be returned 1st.  I've tried the query below, searching for title "crazy shoes".  It's actually being returned 9th out of 9 records.  

When I put the title in quotes, Solr does find it, but it then does not tokenize obviously, and only returns the one record.  I'd like it to return all 9 records, with the title "crazy shoes" first.  Is there some way I should be doing both?

http://99.999.99.999:8080/solr/tracks_collection/select?q={!boost%20b=$dateboost%20v=$qq%20defType=dismax}&dateboost=recip(ms(NOW,releaseDate),3.16e-11,1,1)&fl=text,releaseDate,track_title,language,score&qf=title^99 language^2 text&&qq=crazy shoes
ASKER CERTIFIED SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help so far.  I can award the points and break off a new thread if needed, because I now have follow-up questions, so let me know.  

I've followed your suggestion and created a separate string field for track_title_str, and am trying to use the q.alt to query this with my search terms in quotes.  I'm then trying to boost that field (heavily in this example), but it doesn't seem to work.

http://99.999.99.999:8080/solr/tracks/select?q=crazy+shoes&fl=track_title%2C+text&wt=json&indent=true&defType=edismax&q.alt=%22crazy+shoes%22&qf=track_title_str^222+text&stopwords=true&lowercaseOperators=true
hi,

While i am happy to take points, ;) you should request that this question be reopened as your issue has not been fully resolved, and you have follow-up questions.

thanks

jester