You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Prince Manohar <pr...@gmail.com> on 2019/07/03 18:50:14 UTC

Sort on PointFieldType

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>*

Re: Sort on PointFieldType

Posted by Mark Sholund <ma...@protonmail.com.INVALID>.
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 <pr...@gmail.com> 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>*

Re: Sort on PointFieldType

Posted by Prince Manohar <pr...@gmail.com>.
Thanks a lot.

On Thu, Jul 4, 2019 at 9:19 PM Shawn Heisey <ap...@elyograg.org> 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>*

Re: Sort on PointFieldType

Posted by Shawn Heisey <ap...@elyograg.org>.
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

Re: Sort on PointFieldType

Posted by Prince Manohar <pr...@gmail.com>.
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 <ya...@gmail.com>
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 <pr...@gmail.com>:
>
> > 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>*

Re: Sort on PointFieldType

Posted by Yasufumi Mizoguchi <ya...@gmail.com>.
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 <pr...@gmail.com>:

> 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
> >*
>