lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Storing a field as byte[[]
Date Thu, 13 May 2010 20:03:31 GMT
You can store byte arrays, but you can't search on them.  For integers
you can either pad them out with leading zeros or use NumericField. If
you use NumericField you'll need to use NumericRangeQuery as well.

--
Ian.


On Thu, May 13, 2010 at 8:44 PM, Saurabh Agarwal <srbh.grwl@gmail.com> wrote:
> Hi,
> I am new to lucene. the constructors in Feild show that I can give the value
> as byte[] I wanted to ask if I store a integer as a byte array the how it
> will ve searched during search say file size!!!
>
> because if I use text format the range search will be poor say fs of 10 12
> 20 30 50 100 101 102 will be organised as
> 10
> 100
> 101
> 102
> 12
> 20
> 30
> 50
>
> so range search of size between 10 and 20 will be relatively poor if I store
> values like the order given
>
> Thanks and regards
> Saurabh Agarwal
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message