lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: float or string type for a field with whole number and decimal number values?
Date Tue, 31 May 2016 02:57:36 GMT
bq: Should I change the field type to "float" or "string"?

I'd go with float. Let's assume you want to sort by
this field. 1000000000.00 sorts before 9.0 if you
just use Strings. Plus floats are generally much more
compact.

bq: do I need to delete all documents in the index and do a full indexing

That's the way I'd do it. You can always index to a _new_ collection
(assuming SolrCloud) and use collection aliasing to switch your
search all at once

Best,
Erick

On Sun, May 29, 2016 at 12:56 AM, Derek Poh <dpoh@globalsources.com> wrote:
> I am using solr 4.10.4.
>
>
> On 5/29/2016 3:52 PM, Derek Poh wrote:
>>
>> Hi
>>
>> I have a field that is of "int" type currentlyand it's values are whole
>> numbers.
>>
>> <field name="P_SupplierNeedinessIdx" type="int" indexed="true"
>> stored="true" multiValued="false"/>
>>
>> Due tochange inbusiness requirement, this field will need to take in
>> decimal numbers as well.
>> This fieldis sorted onand filter by range (field:[ 1 to *]).
>>
>> Should I change the field type to "float" or "string"?
>> For the change to take effect, do I need to delete all documents in the
>> index and do a full indexing? Or I can just do a full indexing without
>> theneed to delete all documents first?
>>
>> Derek
>>
>> ----------------------
>> CONFIDENTIALITY NOTICE
>> This e-mail (including any attachments) may contain confidential and/or
>> privileged information. If you are not the intended recipient or have
>> received this e-mail in error, please inform the sender immediately and
>> delete this e-mail (including any attachments) from your computer, and you
>> must not use, disclose to anyone else or copy this e-mail (including any
>> attachments), whether in whole or in part.
>> This e-mail and any reply to it may be monitored for security, legal,
>> regulatory compliance and/or other appropriate reasons.
>
>
>
> ----------------------
> CONFIDENTIALITY NOTICE
> This e-mail (including any attachments) may contain confidential and/or
> privileged information. If you are not the intended recipient or have
> received this e-mail in error, please inform the sender immediately and
> delete this e-mail (including any attachments) from your computer, and you
> must not use, disclose to anyone else or copy this e-mail (including any
> attachments), whether in whole or in part.
> This e-mail and any reply to it may be monitored for security, legal,
> regulatory compliance and/or other appropriate reasons.

Mime
View raw message