Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-04-15
5
Medium Priority
?
450 Views
Last Modified: 2014-04-22
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 -
0
Comment
Question by:Xbradders
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 40003900
couple of questions

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

Author Comment

by:Xbradders
ID: 40004997
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
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 2000 total points
ID: 40005057
what i have done is indexed certain fields as both text and string
title_t is text version of the title and title_s is the string version,

i then search both

i do a couple of processes to tokenize any search strings submitted but if a quoted term is submitted i search specifically for that and do not break it down, and i do full search and tokenized search, seems to work pretty well
0
 

Author Comment

by:Xbradders
ID: 40013107
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
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 40014600
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
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question