Solr 8 - Sort Issue

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

Solr 8 - Sort Issue

Anuj Bhargava
When I sort desc on posting_id sort=posting_id%20desc, I get the following
result
"posting_id":"9999313"
"posting_id":"9999312"
"posting_id":"9999310"

When I sort asc on posting_id sort=posting_id%20asc, I get the following
result
"posting_id":"10005343"
"posting_id":"10005349"
"posting_id":"10005359"

*In descending the 8 figure numbers are not coming up first and in
ascending the 7 figure numbers are not coming up first.*

Entry in schema is -
<field name="posting_id" type="string" indexed="true" stored="true"
required="true" docValues="true" multiValued="false"/>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

MUNENDRA S N
Hi Anuj,
As the field type is String, lexicographical sorting is done, not numeric
sorting.

Regards,
Munendra S N



On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]> wrote:

> When I sort desc on posting_id sort=posting_id%20desc, I get the following
> result
> "posting_id":"9999313"
> "posting_id":"9999312"
> "posting_id":"9999310"
>
> When I sort asc on posting_id sort=posting_id%20asc, I get the following
> result
> "posting_id":"10005343"
> "posting_id":"10005349"
> "posting_id":"10005359"
>
> *In descending the 8 figure numbers are not coming up first and in
> ascending the 7 figure numbers are not coming up first.*
>
> Entry in schema is -
> <field name="posting_id" type="string" indexed="true" stored="true"
> required="true" docValues="true" multiValued="false"/>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Anuj Bhargava
I tried with pint also, but the result was the same. What should I use for
numeric search.

Regards,

Anuj

On Fri, 6 Dec 2019 at 15:55, Munendra S N <[hidden email]> wrote:

> Hi Anuj,
> As the field type is String, lexicographical sorting is done, not numeric
> sorting.
>
> Regards,
> Munendra S N
>
>
>
> On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]> wrote:
>
> > When I sort desc on posting_id sort=posting_id%20desc, I get the
> following
> > result
> > "posting_id":"9999313"
> > "posting_id":"9999312"
> > "posting_id":"9999310"
> >
> > When I sort asc on posting_id sort=posting_id%20asc, I get the following
> > result
> > "posting_id":"10005343"
> > "posting_id":"10005349"
> > "posting_id":"10005359"
> >
> > *In descending the 8 figure numbers are not coming up first and in
> > ascending the 7 figure numbers are not coming up first.*
> >
> > Entry in schema is -
> > <field name="posting_id" type="string" indexed="true" stored="true"
> > required="true" docValues="true" multiValued="false"/>
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

MUNENDRA S N
>
> What should I use for numeric search.

numeric search or numeric sorting?

 I tried with pint also, but the result was the same.

It should have worked. please make sure data is reindexed after fieldType
changes

Regards,
Munendra S N



On Fri, Dec 6, 2019 at 4:10 PM Anuj Bhargava <[hidden email]> wrote:

> I tried with pint also, but the result was the same. What should I use for
> numeric search.
>
> Regards,
>
> Anuj
>
> On Fri, 6 Dec 2019 at 15:55, Munendra S N <[hidden email]> wrote:
>
> > Hi Anuj,
> > As the field type is String, lexicographical sorting is done, not numeric
> > sorting.
> >
> > Regards,
> > Munendra S N
> >
> >
> >
> > On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]> wrote:
> >
> > > When I sort desc on posting_id sort=posting_id%20desc, I get the
> > following
> > > result
> > > "posting_id":"9999313"
> > > "posting_id":"9999312"
> > > "posting_id":"9999310"
> > >
> > > When I sort asc on posting_id sort=posting_id%20asc, I get the
> following
> > > result
> > > "posting_id":"10005343"
> > > "posting_id":"10005349"
> > > "posting_id":"10005359"
> > >
> > > *In descending the 8 figure numbers are not coming up first and in
> > > ascending the 7 figure numbers are not coming up first.*
> > >
> > > Entry in schema is -
> > > <field name="posting_id" type="string" indexed="true" stored="true"
> > > required="true" docValues="true" multiValued="false"/>
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Anuj Bhargava
Numeric sorting. Did the re-indexing. But didn't work.

Regards,

Anuj

On Fri, 6 Dec 2019 at 16:44, Munendra S N <[hidden email]> wrote:

> >
> > What should I use for numeric search.
>
> numeric search or numeric sorting?
>
>  I tried with pint also, but the result was the same.
>
> It should have worked. please make sure data is reindexed after fieldType
> changes
>
> Regards,
> Munendra S N
>
>
>
> On Fri, Dec 6, 2019 at 4:10 PM Anuj Bhargava <[hidden email]> wrote:
>
> > I tried with pint also, but the result was the same. What should I use
> for
> > numeric search.
> >
> > Regards,
> >
> > Anuj
> >
> > On Fri, 6 Dec 2019 at 15:55, Munendra S N <[hidden email]>
> wrote:
> >
> > > Hi Anuj,
> > > As the field type is String, lexicographical sorting is done, not
> numeric
> > > sorting.
> > >
> > > Regards,
> > > Munendra S N
> > >
> > >
> > >
> > > On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]>
> wrote:
> > >
> > > > When I sort desc on posting_id sort=posting_id%20desc, I get the
> > > following
> > > > result
> > > > "posting_id":"9999313"
> > > > "posting_id":"9999312"
> > > > "posting_id":"9999310"
> > > >
> > > > When I sort asc on posting_id sort=posting_id%20asc, I get the
> > following
> > > > result
> > > > "posting_id":"10005343"
> > > > "posting_id":"10005349"
> > > > "posting_id":"10005359"
> > > >
> > > > *In descending the 8 figure numbers are not coming up first and in
> > > > ascending the 7 figure numbers are not coming up first.*
> > > >
> > > > Entry in schema is -
> > > > <field name="posting_id" type="string" indexed="true" stored="true"
> > > > required="true" docValues="true" multiValued="false"/>
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Anuj Bhargava
Tried with plong, pint and string. Reindexed after each change. The sort
results on numeric values being shown are the same -
Ascending
1
10
100
2
2100
3

Descending
9999
999
99
9
888888
88
77777777

On Fri, 6 Dec 2019 at 17:15, Anuj Bhargava <[hidden email]> wrote:

> Numeric sorting. Did the re-indexing. But didn't work.
>
> Regards,
>
> Anuj
>
> On Fri, 6 Dec 2019 at 16:44, Munendra S N <[hidden email]> wrote:
>
>> >
>> > What should I use for numeric search.
>>
>> numeric search or numeric sorting?
>>
>>  I tried with pint also, but the result was the same.
>>
>> It should have worked. please make sure data is reindexed after fieldType
>> changes
>>
>> Regards,
>> Munendra S N
>>
>>
>>
>> On Fri, Dec 6, 2019 at 4:10 PM Anuj Bhargava <[hidden email]> wrote:
>>
>> > I tried with pint also, but the result was the same. What should I use
>> for
>> > numeric search.
>> >
>> > Regards,
>> >
>> > Anuj
>> >
>> > On Fri, 6 Dec 2019 at 15:55, Munendra S N <[hidden email]>
>> wrote:
>> >
>> > > Hi Anuj,
>> > > As the field type is String, lexicographical sorting is done, not
>> numeric
>> > > sorting.
>> > >
>> > > Regards,
>> > > Munendra S N
>> > >
>> > >
>> > >
>> > > On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]>
>> wrote:
>> > >
>> > > > When I sort desc on posting_id sort=posting_id%20desc, I get the
>> > > following
>> > > > result
>> > > > "posting_id":"9999313"
>> > > > "posting_id":"9999312"
>> > > > "posting_id":"9999310"
>> > > >
>> > > > When I sort asc on posting_id sort=posting_id%20asc, I get the
>> > following
>> > > > result
>> > > > "posting_id":"10005343"
>> > > > "posting_id":"10005349"
>> > > > "posting_id":"10005359"
>> > > >
>> > > > *In descending the 8 figure numbers are not coming up first and in
>> > > > ascending the 7 figure numbers are not coming up first.*
>> > > >
>> > > > Entry in schema is -
>> > > > <field name="posting_id" type="string" indexed="true" stored="true"
>> > > > required="true" docValues="true" multiValued="false"/>
>> > > >
>> > >
>> >
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Paras Lehana
Hi Anuj,

Please post the part of your schema for this field and its fieldType.

On Sat, 7 Dec 2019 at 10:38, Anuj Bhargava <[hidden email]> wrote:

> Tried with plong, pint and string. Reindexed after each change. The sort
> results on numeric values being shown are the same -
> Ascending
> 1
> 10
> 100
> 2
> 2100
> 3
>
> Descending
> 9999
> 999
> 99
> 9
> 888888
> 88
> 77777777
>
> On Fri, 6 Dec 2019 at 17:15, Anuj Bhargava <[hidden email]> wrote:
>
> > Numeric sorting. Did the re-indexing. But didn't work.
> >
> > Regards,
> >
> > Anuj
> >
> > On Fri, 6 Dec 2019 at 16:44, Munendra S N <[hidden email]>
> wrote:
> >
> >> >
> >> > What should I use for numeric search.
> >>
> >> numeric search or numeric sorting?
> >>
> >>  I tried with pint also, but the result was the same.
> >>
> >> It should have worked. please make sure data is reindexed after
> fieldType
> >> changes
> >>
> >> Regards,
> >> Munendra S N
> >>
> >>
> >>
> >> On Fri, Dec 6, 2019 at 4:10 PM Anuj Bhargava <[hidden email]>
> wrote:
> >>
> >> > I tried with pint also, but the result was the same. What should I use
> >> for
> >> > numeric search.
> >> >
> >> > Regards,
> >> >
> >> > Anuj
> >> >
> >> > On Fri, 6 Dec 2019 at 15:55, Munendra S N <[hidden email]>
> >> wrote:
> >> >
> >> > > Hi Anuj,
> >> > > As the field type is String, lexicographical sorting is done, not
> >> numeric
> >> > > sorting.
> >> > >
> >> > > Regards,
> >> > > Munendra S N
> >> > >
> >> > >
> >> > >
> >> > > On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]>
> >> wrote:
> >> > >
> >> > > > When I sort desc on posting_id sort=posting_id%20desc, I get the
> >> > > following
> >> > > > result
> >> > > > "posting_id":"9999313"
> >> > > > "posting_id":"9999312"
> >> > > > "posting_id":"9999310"
> >> > > >
> >> > > > When I sort asc on posting_id sort=posting_id%20asc, I get the
> >> > following
> >> > > > result
> >> > > > "posting_id":"10005343"
> >> > > > "posting_id":"10005349"
> >> > > > "posting_id":"10005359"
> >> > > >
> >> > > > *In descending the 8 figure numbers are not coming up first and in
> >> > > > ascending the 7 figure numbers are not coming up first.*
> >> > > >
> >> > > > Entry in schema is -
> >> > > > <field name="posting_id" type="string" indexed="true"
> stored="true"
> >> > > > required="true" docValues="true" multiValued="false"/>
> >> > > >
> >> > >
> >> >
> >>
> >
>


--
--
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

--
*
*

 <https://www.facebook.com/IndiaMART/videos/578196442936091/>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Anuj Bhargava
Hi Paras,

<field name="posting_id" type="pint" indexed="true" stored="true"
required="true" multiValued="false"/>

  <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
  <fieldType name="pints" class="solr.IntPointField" docValues="true"
multiValued="true"/>
  <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
  <fieldType name="plongs" class="solr.LongPointField" docValues="true"
multiValued="true"/>
  <fieldType name="point" class="solr.PointType" subFieldSuffix="_d"
dimension="2"/>
  <fieldType name="random" class="solr.RandomSortField" indexed="true"/>
  <fieldType name="string" class="solr.StrField" sortMissingLast="true"
docValues="true"/>
  <fieldType name="strings" class="solr.StrField" sortMissingLast="true"
docValues="true" multiValued="true"/>

Regards,

Anuj

On Mon, 9 Dec 2019 at 10:37, Paras Lehana <[hidden email]>
wrote:

> Hi Anuj,
>
> Please post the part of your schema for this field and its fieldType.
>
> On Sat, 7 Dec 2019 at 10:38, Anuj Bhargava <[hidden email]> wrote:
>
> > Tried with plong, pint and string. Reindexed after each change. The sort
> > results on numeric values being shown are the same -
> > Ascending
> > 1
> > 10
> > 100
> > 2
> > 2100
> > 3
> >
> > Descending
> > 9999
> > 999
> > 99
> > 9
> > 888888
> > 88
> > 77777777
> >
> > On Fri, 6 Dec 2019 at 17:15, Anuj Bhargava <[hidden email]> wrote:
> >
> > > Numeric sorting. Did the re-indexing. But didn't work.
> > >
> > > Regards,
> > >
> > > Anuj
> > >
> > > On Fri, 6 Dec 2019 at 16:44, Munendra S N <[hidden email]>
> > wrote:
> > >
> > >> >
> > >> > What should I use for numeric search.
> > >>
> > >> numeric search or numeric sorting?
> > >>
> > >>  I tried with pint also, but the result was the same.
> > >>
> > >> It should have worked. please make sure data is reindexed after
> > fieldType
> > >> changes
> > >>
> > >> Regards,
> > >> Munendra S N
> > >>
> > >>
> > >>
> > >> On Fri, Dec 6, 2019 at 4:10 PM Anuj Bhargava <[hidden email]>
> > wrote:
> > >>
> > >> > I tried with pint also, but the result was the same. What should I
> use
> > >> for
> > >> > numeric search.
> > >> >
> > >> > Regards,
> > >> >
> > >> > Anuj
> > >> >
> > >> > On Fri, 6 Dec 2019 at 15:55, Munendra S N <[hidden email]>
> > >> wrote:
> > >> >
> > >> > > Hi Anuj,
> > >> > > As the field type is String, lexicographical sorting is done, not
> > >> numeric
> > >> > > sorting.
> > >> > >
> > >> > > Regards,
> > >> > > Munendra S N
> > >> > >
> > >> > >
> > >> > >
> > >> > > On Fri, Dec 6, 2019 at 3:12 PM Anuj Bhargava <[hidden email]>
> > >> wrote:
> > >> > >
> > >> > > > When I sort desc on posting_id sort=posting_id%20desc, I get the
> > >> > > following
> > >> > > > result
> > >> > > > "posting_id":"9999313"
> > >> > > > "posting_id":"9999312"
> > >> > > > "posting_id":"9999310"
> > >> > > >
> > >> > > > When I sort asc on posting_id sort=posting_id%20asc, I get the
> > >> > following
> > >> > > > result
> > >> > > > "posting_id":"10005343"
> > >> > > > "posting_id":"10005349"
> > >> > > > "posting_id":"10005359"
> > >> > > >
> > >> > > > *In descending the 8 figure numbers are not coming up first and
> in
> > >> > > > ascending the 7 figure numbers are not coming up first.*
> > >> > > >
> > >> > > > Entry in schema is -
> > >> > > > <field name="posting_id" type="string" indexed="true"
> > stored="true"
> > >> > > > required="true" docValues="true" multiValued="false"/>
> > >> > > >
> > >> > >
> > >> >
> > >>
> > >
> >
>
>
> --
> --
> Regards,
>
> *Paras Lehana* [65871]
> Development Engineer, Auto-Suggest,
> IndiaMART Intermesh Ltd.
>
> 8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
> Noida, UP, IN - 201303
>
> Mob.: +91-9560911996
> Work: 01203916600 | Extn:  *8173*
>
> --
> *
> *
>
>  <https://www.facebook.com/IndiaMART/videos/578196442936091/>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Paras Lehana
Hi Anuj,

Thanks for that.

   1. Go to Schema (left side section) > choose your field posting_id and
   post the screenshot. Are you able to see IntPointField or pint there?.
   2. Please post the query you are using for sorting. Also, post a sample
   of response.

--
*
*

 <https://www.facebook.com/IndiaMART/videos/578196442936091/>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Anuj Bhargava
Thanks Paras, that was very helpful. Restarted solr and for posting_id it
showed pint earlier it was showing string.

However, I change pint to plong because it was taking an awful lot of time
to index.

Thanks again,

Regards,
ANuj

On Mon, 9 Dec 2019 at 11:32, Paras Lehana <[hidden email]>
wrote:

> Hi Anuj,
>
> Thanks for that.
>
>    1. Go to Schema (left side section) > choose your field posting_id and
>    post the screenshot. Are you able to see IntPointField or pint there?.
>    2. Please post the query you are using for sorting. Also, post a sample
>    of response.
>
> --
> *
> *
>
>  <https://www.facebook.com/IndiaMART/videos/578196442936091/>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 8 - Sort Issue

Paras Lehana
Hi Anuj,

Glad that it worked. I ask for schema screenshot everyone because I'm
mostly sure of the schema not being reloaded or something.

However, I change pint to plong because it was taking an awful lot of time
> to index.


Strange! Why do you think that this is the case?

On Mon, 9 Dec 2019 at 14:06, Anuj Bhargava <[hidden email]> wrote:

> Thanks Paras, that was very helpful. Restarted solr and for posting_id it
> showed pint earlier it was showing string.
>
> However, I change pint to plong because it was taking an awful lot of time
> to index.
>
> Thanks again,
>
> Regards,
> ANuj
>
> On Mon, 9 Dec 2019 at 11:32, Paras Lehana <[hidden email]>
> wrote:
>
> > Hi Anuj,
> >
> > Thanks for that.
> >
> >    1. Go to Schema (left side section) > choose your field posting_id and
> >    post the screenshot. Are you able to see IntPointField or pint there?.
> >    2. Please post the query you are using for sorting. Also, post a
> sample
> >    of response.
> >
> > --
> > *
> > *
> >
> >  <https://www.facebook.com/IndiaMART/videos/578196442936091/>
> >
>


--
--
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

--
*
*

 <https://www.facebook.com/IndiaMART/videos/578196442936091/>