(Sorry for so many messages in a row...) For the record, I figured out something that will work, although it is somewhat inelegant. My q parameter is now:
(+content:notes -genre:Citation)^20 (+content:notes genre:Citation)^0.01 Can I improve on that? On Mon, Oct 31, 2011 at 5:52 PM, Paul <p...@nines.org> wrote: > I studied the results with debugQuery, and I understand how the search > is working. The two scores for the two terms are added together, so > specifying a boost less than one still adds to the score. For > instance, in the first result, content:notes has a score of 1.4892359 > and genre:Citation^0.01 has a score of 0.0045761107. Those two numbers > are added together to get the total score. > > I tried putting a negative boost number in, but that isn't legal. > > Is there a way to express "genre does not equal Citation" as an > optional parameter that I can boost? > > On Mon, Oct 31, 2011 at 2:26 PM, Paul <p...@nines.org> wrote: >> I had been experimenting with bq. >> >> I switched to boost like you suggested, and get the following error >> from solr: "can not use FieldCache on multivalued field: genre" >> >> But that sounds like the solution I'd want, if it worked, since it's >> more flexible than having to reindex. >> >> On Mon, Oct 31, 2011 at 10:41 AM, Erik Hatcher <erik.hatc...@gmail.com> >> wrote: >>> Paul - look at debugQuery=true output to see why scores end up the way they >>> do. Use the explainOther to hone in on a specific document to get it's >>> explanation. The math'll tell you why it's working the way it is. It's >>> more than just likely that some other scoring factors are overweighting >>> things. >>> >>> Also, now that I think about it, you'd be better off leveraging edismax and >>> the boost parameter. Don't mess with your main q(uery), use >>> boost=genre:Citation^0.01 or something like that. boost params (not bq!) >>> are multiplied into the score, not added. Maybe that'll be more to your >>> liking? >>> >>> Erik >>> >>> >>> On Oct 31, 2011, at 10:19 , Paul wrote: >>> >>>> Thanks Erik. They don't need to absolutely always be the bottom-most >>>> -- just not near the top. But that sounds like an easy way to do it, >>>> especially since it is a lot easier to reindex now than it used to be. >>>> >>>> I would like to know why my query had no effect, though. There's >>>> obviously something I don't get about queries. >>>> >>>> On Mon, Oct 31, 2011 at 10:08 AM, Erik Hatcher <erik.hatc...@gmail.com> >>>> wrote: >>>>> Paul (*bows* to the NINES!) - >>>>> >>>>> If you literally want Citations always at the bottom regardless of other >>>>> relevancy, then perhaps consider indexing boolean top_sort as true for >>>>> everything Citations and false otherwise, then use &sort=top_sort >>>>> asc,score desc (or do you need to desc top_sort? true then false or >>>>> false then true?) >>>>> >>>>> Then you can have Citations literally at the bottom (and within that >>>>> sorted in score order) and likewise with non-Citations at the top and >>>>> sorted score order within that. Other tricks still risk having Citations >>>>> mixed in should relevancy score be high enough. >>>>> >>>>> The morale of this story is: if you want to hard sort by something, then >>>>> make a sort field that does it how you like rather than trying to get >>>>> relevancy scoring to do it for you. >>>>> >>>>> Erik >>>>> >>>>> >>>>> On Oct 28, 2011, at 17:17 , Paul wrote: >>>>> >>>>>> (I am using solr 3.4 and edismax.) >>>>>> >>>>>> In my index, I have a multivalued field named "genre". One of the >>>>>> values this field can have is "Citation". I would like documents that >>>>>> have a genre field of Citation to always be at the bottom of the >>>>>> search results. >>>>>> >>>>>> I've been experimenting, but I can't seem to figure out the syntax of >>>>>> the search I need. Here is the search that seems most logical to me >>>>>> (newlines added here for readability): >>>>>> >>>>>> q=%2bcontent%3Anotes+genre%3ACitation^0.01 >>>>>> &start=0 >>>>>> &rows=3 >>>>>> &fl=genre+title >>>>>> &version=2.2 >>>>>> &defType=edismax >>>>>> >>>>>> I get the same results whether I include "genre%3ACitation^0.01" or not. >>>>>> >>>>>> Just to see if my names were correct, I put a minus sign before >>>>>> "genre" and it did, in fact, stop returning all the documents >>>>>> containing Citation. >>>>>> >>>>>> What am I doing wrong? >>>>>> >>>>>> Here are the results from the above query: >>>>>> >>>>>> <response> >>>>>> <lst name="responseHeader"> >>>>>> <int name="status">0</int> >>>>>> <int name="QTime">1</int> >>>>>> <lst name="params"> >>>>>> <str name="fl">genre title </str> >>>>>> <str name="start">0</str> >>>>>> <str name="q">+content:notes genre:Citation^0.01</str> >>>>>> <str name="rows">3</str> >>>>>> <str name="version">2.2</str> >>>>>> <str name="defType">edismax</str> >>>>>> </lst> >>>>>> </lst> >>>>>> <result name="response" numFound="1276" start="0"> >>>>>> <doc> >>>>>> <arr name="genre"><str>Citation</str><str>Fiction</str></arr> >>>>>> <str name="title">Notes on novelists With some other notes</str> >>>>>> </doc> >>>>>> <doc> >>>>>> <arr name="genre"><str>Citation</str></arr> >>>>>> <str name="title">Novel notes</str> >>>>>> </doc> >>>>>> <doc> >>>>>> <arr name="genre"><str>Citation</str></arr> >>>>>> <str name="title">Knock about notes</str> >>>>>> </doc> >>>>>> </result> >>>>>> </response> >>>>> >>>>> >>> >>> >> >