Solved

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

Posted on 2014-04-15
5
435 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

627 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