Hi Hoss,

Thanks for the detailed response.

My XY problem is:

1) I am trying to search for a complex query:
q={!type=edismax qf="abstract^0.02 title^0.08 categorysearch^0.05"
boost='eqsim(alltokens,"xyz")' v='+tokens5:"xyz" '}

Which answers my query needs. BUT, my boost function actually changes some
of the results to be of score 0, which I want to be excluded from the
result set.

2) This is why I used the frange query to solve the issue with the score 0:
q={!frange l=0 incl=false}query({!type=edismax qf="abstract^0.02 title^0.08
categorysearch^0.05" boost='eqsim(alltokens,"xyz")' v='+tokens5:"xyz" '})

But this time, the remaining results lost their *boosted* scores, and
therefore the sort by score got all mixed up.

3) I assume I can use filter queries, but from my understanding FQs
actually perform another query before the main one and these queries are
expensive in time and I would like to avoid it if possible.

Hope this explains a bit more.

Thanks,
Lev

On Tue, Nov 22, 2011 at 9:15 PM, Chris Hostetter
<hossman_luc...@fucit.org>wrote:

>
> : > q={!frange l=0 incl=false}query({!type=edismax qf="abstract^0.02
> : > title^0.08 categorysearch^0.05" boost='eqsim(alltokens,"xyz")'
> : > v='+tokens5:"xyz" '})
> : >
> : >
> : > With the above query, I am getting only the results that I want, the
> ones
> : > whose score after my FucntionQuery are above 0, but the problem now is
> that
> : > the final score for all results is changed to 1, which affects the
> sorting.
> : >
> : > How can I keep the original score that is calculated by the edismax
> query?
>
> a) Like i said.  details matter.
>
> In your earlier messages you mentioned that you were wrapping a function
> arround a query and wanted to not have the function match anythign where
> the result was 0 -- the suggestions provided have done that.
>
> this is the first time you mentioned that you needed the values returned
> by the function as the scores of the documents (had you mentioned that you
> might have gotten differnet answers)
>
> b) if you look closely at the suggestion from André, you'll see that his
> specific suggestion will actually do what you want if you follow it --
> express the query you want in the "q" param (so you get the scores from
> it) and then express an "fq" that refers to the "q" query as a variable...
>
> : >>>> q=ipod&fq={!frange l=0 incl=false}query($q)
>
> c) Based on the concrete example you've given above, i'ts not clear to me
> that you actually need any of this -- if the above query is giving you the
> results you want, but you want the scores from the edismax query to be
> used as the final scores of the function, then there is no need to wrap
> the query in any sort of function at all, or exclude any 0 values....
>
> this should be exactly what you want...
>
> q={!type=edismax qf="abstract^0.02 title^0.08 categorysearch^0.05"
> boost='eqsim(alltokens,"xyz")' v='+tokens5:"xyz" '}
>
> ...why exactly did you think you needed to wrap that query in a function?
>
> https://people.apache.org/~hossman/#xyproblem
> XY Problem
>
> Your question appears to be an "XY Problem" ... that is: you are dealing
> with "X", you are assuming "Y" will help you, and you are asking about "Y"
> without giving more details about the "X" so that we can understand the
> full issue.  Perhaps the best solution doesn't involve "Y" at all?
> See Also: http://www.perlmonks.org/index.pl?node_id=542341
>
>
>
>
> -Hoss

Reply via email to