Okay, makes sense. As to your question - making a new ValueSourceParser
that handles 'equals' sounds pretty straight-forward.

If it helps, I have somewhere an Ant project that will unpack Solr and
compile custom components against it. I could push that to github or
something.

Upayavira

On Thu, Nov 12, 2015, at 07:59 AM, billnb...@gmail.com wrote:
> fl=$b tells me it works. Or I can do a sort=$b asc
> 
> The idea is to calculate a score but only include geo if it is not a
> national search. Do we want to send in a parameter into the QT which
> allows us to omit geo from national searches....
> 
> 
> Bill Bell
> Sent from mobile
> 
> > On Nov 11, 2015, at 1:15 AM, Upayavira <u...@odoko.co.uk> wrote:
> > 
> > I concur with Jan - what does b= do? 
> > 
> > Also asking, how did you identify that it worked?
> > 
> > Upayavira
> > 
> >> On Wed, Nov 11, 2015, at 02:58 AM, William Bell wrote:
> >> I was able to get it to work kinda with a map().
> >> 
> >> http://localhost:8983/solr/select?q=*:*&radius=1&b=
> >> <http://localhost:8983/solr/select?q=*:*&radius=national&b=if(equals($radius,%27national%27),0,geodist())>
> >> map($radius,1,1,0,geodist())
> >> 
> >> Where 1= National
> >> 
> >> Do you have an example of a SearchComponent? It would be pretty easy to
> >> copy map() and develop an equals() right?
> >> 
> >> if(equals($radius, 'national'), 0, geodist())
> >> 
> >> This would probably be useful for everyone.
> >> 
> >> On Tue, Nov 10, 2015 at 4:05 PM, Jan Høydahl <jan....@cominvent.com>
> >> wrote:
> >> 
> >>> Where is your “b” parameter used? I think that instead of trying to set a
> >>> new “b” http param (which solr will not evaluate as a function), you 
> >>> should
> >>> instead try to insert your function or switch qParser directly where the
> >>> “b” param is used, e.g. in a bq or similar.
> >>> 
> >>> A bit heavy weight, but you could of course write a custom SearchComponent
> >>> to construct your “b” parameter...
> >>> 
> >>> --
> >>> Jan Høydahl, search solution architect
> >>> Cominvent AS - www.cominvent.com
> >>> 
> >>>> 10. nov. 2015 kl. 23.52 skrev William Bell <billnb...@gmail.com>:
> >>>> 
> >>>> We are trying to look at a value, and change another value based on that.
> >>>> 
> >>>> For example, for national search we want to pass in radius=national, and
> >>>> then set another variable equal to 0, else set the other variable = to
> >>>> geodist() calculation.
> >>>> 
> >>>> We tried {!switch} but this only appears to work on fq/q. There is no
> >>>> function for constants for equals....
> >>> http://localhost:8983/solr/select?q=*:*&radius=national&b=if(equals($radius,'national'),0,geodist())
> >>>> 
> >>>> This does not work:
> >>>> 
> >>>> http://localhost:8983/solr/select?q=*:*&radius=national&b={!switch
> >>>> case.national=0 default=geodist() v=$radius}
> >>>> 
> >>>> Ideas?
> >>>> 
> >>>> 
> >>>> 
> >>>> --
> >>>> Bill Bell
> >>>> billnb...@gmail.com
> >>>> cell 720-256-8076
> >> 
> >> 
> >> -- 
> >> Bill Bell
> >> billnb...@gmail.com
> >> cell 720-256-8076

Reply via email to