: i'm not sure i follow what you're saying on #3. let me clarify in case it's
: on my end. i was wanting to *eventually* set a lower bound of -10%size1 and
: an upper of +10%size1. for the sake of experimentation i started with just

lower bound "of what" ?

write out the math equation you want to satisfy, and you'll see that based 
on your original problem statement there are 3 numbers involved

  X) 0.1
  Y) some fixed numeric value give by your user
  Z) some field value of each document

You said you wnat to find documents where the field value Z is within 
10% (X) of the value Y that your user specified...

        Find all docs such that:
                Z <= Y + Y*X
                Z >= Y - Y*X

At no point in the query/function you were attempting, did you ever 
specify fixed numeric value provided by your user.  What you had written 
was:

        Find all docs such that:
                Z >= Z + Z*X

That's the point i'm making in #3...


: > : 3) right. i hadn't bothered with the upper limit yet simply for sake of
: > : less complexity / chance to fk it up. wanted to get the function working
: > : for lower before worrying about adding u= and getting the query refined
: >
: > To be very clear: even if what you were trying to do worked as you wrote
: > it, adding an upper bound wouldn't change the fact that the comparison you
: > were trying ot make in your query doesn't match the problem statement in
: > your question, and doesn't make sense in general -- you need to compare
: > the field value with 10% of some OTHER input value -- not 10% of itself.
: >
: > Adding an upper bound that was similar to hte lower bound you were trying
: > would have simply prevented any docs from mathcing at all.

        ...

: > : > : Expected identifier at pos 29 str='{!frange l=sum(size1,
: > product(size1,
: > : > : .10))}size1

        ...

: > : > 3) even if you could pass a function for the "l" param, conceptually
: > what
: > : > you are asking for doesn't really make much sense ... you are asking
: > solr
: > : > to only return documents where the value of the "size1" field is in a
: > : > range between X and infinity, where X is defined as the sum of the
: > value
: > : > of the "size1" field plus 10% of the value of the "size1" field.
: > : >
: > : > In other words: "give me all docs where S * 1.1 <= S"
: > : >
: > : > Basically you are asking it to return all documents with a negative
: > value
: > : > in the "size1" field.


-Hoss
http://www.lucidworks.com/

Reply via email to