Sort on PointFieldType

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Sort on PointFieldType

Prince Manohar
Reply | Threaded
Open this post in threaded view
|

Re: Sort on PointFieldType

Mark Sholund
My thought is that “greater than” and “less than” are generally undefined for n-dimensional points where n>1. 
Is (45,45) > (-45,-45)?  If you’re talking about distance from (0,0) they’re “equal”. If you’re talking about distance from some arbitrary point then they are not necessarily “equal”; what would make one sort higher/lower?


On Wed, Jul 3, 2019 at 2:50 PM, Prince Manohar <[hidden email]> wrote:
Hi,
I have a *field* that is of *PointType *and I tried to sort on that field.
But looks like sorting does not work on PointType.
Or am I doing something wrong?
Find my query below:-
http://localhost:8983/solr/testcollection/select?indent=on&q=*:*&sort=abc.pqr_d
DESC&wt=json
<http://localhost:8983/solr/markustest1/select?indent=on&q=*:*&sort=facet_en_price.UNITED_STATES_d%20DESC&wt=json>

--
*Regards,
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*Prince Manohar
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*B.Tech (InformationTechnology)
<https://rawgit.com/princemanohar/cv/master/Prince_Manohar_Resume.pdf>*
*Bengaluru
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*+91 7797045315
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*



publicKey - mark.d.sholund@protonmail.com - 9ef697579bd3b572c30868287631be62705a0bd2.asc (948 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sort on PointFieldType

Yasufumi Mizoguchi
In reply to this post by Prince Manohar
Hi,

Which version of Solr are you using?
And what is the field settings?

Reference guide says that sorting with single valued *PointType fields
requires docValues="true" option in field settings.
https://lucene.apache.org/solr/guide/8_1/field-types-included-with-solr.html#field-types-included-with-solr

Thanks,
Yasufumi

2019年7月4日(木) 3:50 Prince Manohar <[hidden email]>:
Reply | Threaded
Open this post in threaded view
|

Re: Sort on PointFieldType

Prince Manohar
Thanks for the answers.
I am using Solr version *6.4.2*. I got your answers.

I have another question. Can we use a *Range query* on point field?

I am trying to do something like


*fq=abc.pqr_d:[ 1500 TO 2000 ]*

Is it a valid filter?




On Thu, Jul 4, 2019 at 1:47 PM Yasufumi Mizoguchi <[hidden email]>
wrote:

> Hi,
>
> Which version of Solr are you using?
> And what is the field settings?
>
> Reference guide says that sorting with single valued *PointType fields
> requires docValues="true" option in field settings.
>
> https://lucene.apache.org/solr/guide/8_1/field-types-included-with-solr.html#field-types-included-with-solr
>
> Thanks,
> Yasufumi
>
> 2019年7月4日(木) 3:50 Prince Manohar <[hidden email]>:
>
> > Hi,
> > I have a *field* that is of *PointType *and I tried to sort on that
> field.
> > But looks like sorting does not work on PointType.
> > Or am I doing something wrong?
> > Find my query below:-
> >
> >
> http://localhost:8983/solr/testcollection/select?indent=on&q=*:*&sort=abc.pqr_d
> > DESC&wt=json
> > <
> http://localhost:8983/solr/testcollection/select?indent=on&q=*:*&sort=abc.pqr_dDESC&wt=json
> >
> > <
> >
> http://localhost:8983/solr/markustest1/select?indent=on&q=*:*&sort=facet_en_price.UNITED_STATES_d%20DESC&wt=json
> > >
> >
> > --
> > *Regards,
> > <
> >
> https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf
> > >*
> > *Prince Manohar
> > <
> >
> https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf
> > >*
> > *B.Tech (InformationTechnology)
> > <https://rawgit.com/princemanohar/cv/master/Prince_Manohar_Resume.pdf>*
> > *Bengaluru
> > <
> >
> https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf
> > >*
> > *+91 7797045315
> > <
> >
> https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf
> > >*
> >
>


--
*Regards,
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*Prince Manohar
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*B.Tech (InformationTechnology)
<https://rawgit.com/princemanohar/cv/master/Prince_Manohar_Resume.pdf>*
*Bengaluru
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*+91 7797045315
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
Reply | Threaded
Open this post in threaded view
|

Re: Sort on PointFieldType

Shawn Heisey-2
On 7/4/2019 9:14 AM, Prince Manohar wrote:
> I am using Solr version *6.4.2*. I got your answers.
>
> I have another question. Can we use a *Range query* on point field?
>
> I am trying to do something like
>
> *fq=abc.pqr_d:[ 1500 TO 2000 ]*
>
> Is it a valid filter?

Yes.  In fact, range queries are one of the areas where Point fields are
faster than Trie fields.

Something that Point fields do slower than Trie is a simple value
lookup.  A query like this:

abc.pqr_d:5000

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

Re: Sort on PointFieldType

Prince Manohar
Thanks a lot.

On Thu, Jul 4, 2019 at 9:19 PM Shawn Heisey <[hidden email]> wrote:

> On 7/4/2019 9:14 AM, Prince Manohar wrote:
> > I am using Solr version *6.4.2*. I got your answers.
> >
> > I have another question. Can we use a *Range query* on point field?
> >
> > I am trying to do something like
> >
> > *fq=abc.pqr_d:[ 1500 TO 2000 ]*
> >
> > Is it a valid filter?
>
> Yes.  In fact, range queries are one of the areas where Point fields are
> faster than Trie fields.
>
> Something that Point fields do slower than Trie is a simple value
> lookup.  A query like this:
>
> abc.pqr_d:5000
>
> Thanks,
> Shawn
>


--
*Regards,
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*Prince Manohar
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*B.Tech (InformationTechnology)
<https://rawgit.com/princemanohar/cv/master/Prince_Manohar_Resume.pdf>*
*Bengaluru
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*
*+91 7797045315
<https://rawgit.com/princemanohar/cv/master/resume7797045315-princemanohar0909.pdf>*