Solved

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

Posted on 2014-04-15
5
425 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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

830 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