Re: edismax: sorting on numeric fields

2019-02-17 Thread Nicolas Paris
hi On Sun, Feb 17, 2019 at 09:40:43AM +0100, Jan Høydahl wrote: > q=kind:animal&wantedweight=50&sort=abs(sub(weight,wantedweight)) asc *sort function* looks a great way. I did not mention very clearly I d'like to use edsimax and add some weight to some fields (such *description* in the below exa

Re: edismax: sorting on numeric fields

2019-02-17 Thread Jan Høydahl
q=kind:animal&wantedweight=50&sort=abs(sub(weight,wantedweight)) asc Jan Høydahl > 16. feb. 2019 kl. 17:08 skrev Dave : > > Sounds like you need to use code and post process your results as it sounds > too specific to your use case. Just my opinion, unless you want to get into > spacial querie

Re: edismax: sorting on numeric fields

2019-02-16 Thread Dave
Sounds like you need to use code and post process your results as it sounds too specific to your use case. Just my opinion, unless you want to get into spacial queries which is a whole different animal and something I don’t think many have experience with, including myself > On Feb 16, 2019, a

Re: edismax: sorting on numeric fields

2019-02-16 Thread Erick Erickson
Well, you haven't defined "distance" so it's hard to say. But what you _probably_ want is to sort by function. See: https://lucene.apache.org/solr/guide/6_6/function-queries.html Best, Erick On Sat, Feb 16, 2019 at 7:19 AM Nicolas Paris wrote: > > Hi > > Thanks. > To clarify, I don't want to sor

Re: edismax: sorting on numeric fields

2019-02-16 Thread Nicolas Paris
Hi Thanks. To clarify, I don't want to sort by numeric fields, instead, I d'like to get sort by distance to my query. On Thu, Feb 14, 2019 at 06:20:19PM -0500, Gus Heck wrote: > Hi Niclolas, > > Solr has no difficulty sorting on numeric fields if they are indexed as a > numeric type. Just use "

Re: edismax: sorting on numeric fields

2019-02-14 Thread Gus Heck
Hi Niclolas, Solr has no difficulty sorting on numeric fields if they are indexed as a numeric type. Just use "&sort=weight asc" If you're field is indexed as text of course it won't sort properly, but then you should fix your schema. -Gus On Thu, Feb 14, 2019 at 4:10 PM David Hastings wrote:

Re: edismax: sorting on numeric fields

2019-02-14 Thread David Hastings
Not clearly understanding your question here. if your query is q=kind:animal weight:50 you will get no results, as nothing matches (assuming a q.op of AND) On Thu, Feb 14, 2019 at 4:06 PM Nicolas Paris wrote: > Hi > > I have a numeric field (say "weight") and I d'like to be able to get > resul

edismax: sorting on numeric fields

2019-02-14 Thread Nicolas Paris
Hi I have a numeric field (say "weight") and I d'like to be able to get results sorted. q=kind:animal weight:50 pf=kind^2 weight^3 would return: name=dog, kind=animal, weight=51 name=tiger, kind=animal,weight=150 name=elephant, kind=animal,weight=2000 In other terms how to deal with numeric fie