You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by "Joao.Faria" <Jo...@portima.com> on 2018/01/08 18:00:26 UTC
Lucene .Net Leading Zeros Issue
Hi,
I'm finding hard to tackle a specific use case with Lucene.
I'm trying to index a field with the following value: 0075.
From my understanding this field should be indexed as a String. So, I use StringField class.
What is happening is that somehow Lucene is converting this value to an Int64, and storing the value 75 so when I retrieve the value from the index I get 75 instead of 0075.
Can you please help me here?
Lucene Version:
Lucene.Net 4.8.0.770-beta
Best regards,
Re: Lucene .Net Leading Zeros Issue
Posted by 小康 <xi...@cnblogs.com>.
Hi,
Can you give your code about index a field?
2018-01-09 2:56 GMT+08:00 JA Purcell <9u...@gmail.com>:
> Hi,
>
> I would try storing it as a Numeric Field, but I can't say for sure if it
> keeps trailing zeroes.
>
> Adam
>
> On Mon, Jan 8, 2018 at 10:16 AM Joao.Faria <Jo...@portima.com> wrote:
>
> > Hi,
> >
> > I'm finding hard to tackle a specific use case with Lucene.
> >
> > I'm trying to index a field with the following value: 0075.
> >
> > From my understanding this field should be indexed as a String. So, I use
> > StringField class.
> > What is happening is that somehow Lucene is converting this value to an
> > Int64, and storing the value 75 so when I retrieve the value from the
> index
> > I get 75 instead of 0075.
> >
> > Can you please help me here?
> > Lucene Version:
> >
> > Lucene.Net 4.8.0.770-beta
> >
> > Best regards,
> >
> >
> >
> >
>
Re: Lucene .Net Leading Zeros Issue
Posted by JA Purcell <9u...@gmail.com>.
Hi,
I would try storing it as a Numeric Field, but I can't say for sure if it
keeps trailing zeroes.
Adam
On Mon, Jan 8, 2018 at 10:16 AM Joao.Faria <Jo...@portima.com> wrote:
> Hi,
>
> I'm finding hard to tackle a specific use case with Lucene.
>
> I'm trying to index a field with the following value: 0075.
>
> From my understanding this field should be indexed as a String. So, I use
> StringField class.
> What is happening is that somehow Lucene is converting this value to an
> Int64, and storing the value 75 so when I retrieve the value from the index
> I get 75 instead of 0075.
>
> Can you please help me here?
> Lucene Version:
>
> Lucene.Net 4.8.0.770-beta
>
> Best regards,
>
>
>
>
RE: Lucene .Net Leading Zeros Issue
Posted by Shad Storhaug <sh...@shadstorhaug.com>.
This bug was fixed (along with several hundred others) in Lucene.Net-beta00005 on NuGet:
https://www.nuget.org/packages/Lucene.Net/
The solution is to upgrade to the latest version.
Thanks,
Shad Storhaug (NightOwl888)
-----Original Message-----
From: Joao.Faria [mailto:Joao.Faria@portima.com]
Sent: Tuesday, January 9, 2018 1:00 AM
To: user@lucenenet.apache.org
Subject: Lucene .Net Leading Zeros Issue
Hi,
I'm finding hard to tackle a specific use case with Lucene.
I'm trying to index a field with the following value: 0075.
From my understanding this field should be indexed as a String. So, I use StringField class.
What is happening is that somehow Lucene is converting this value to an Int64, and storing the value 75 so when I retrieve the value from the index I get 75 instead of 0075.
Can you please help me here?
Lucene Version:
Lucene.Net 4.8.0.770-beta
Best regards,