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 Derek Poh <dp...@globalsources.com> on 2016/06/01 02:15:28 UTC

Re: float or string type for a field with whole number and decimal number values?

Sorry about that.

Thank you for your explanation. I still have some questions on using and 
setting up collection alias for my current situation. I will start a new 
threadon this.

On 5/31/2016 11:21 PM, Erick Erickson wrote:
> First, when changing the topic of the thread, please start a new thread. This
> is called "thread hijacking" and makes it difficult to find threads later.
>
> Collection aliasing does not do _anything_ about adding/deleting/whatever.
> It's just a way to do exactly what you want. Your clients point to
> mycollection.
>
> You use the CREATEALIAS command to point mycollection to mycollection_1.
> Thereafter you can do anything you want to mycollection_1 using either name.
>
> That is, you can address mycollection_1 explicitly. You can use mycollection. It
> doesn't matter.
>
> Then you can create mycollection_2. So far you can _only_ address mycollection_2
> explicitly. You then use the CREATEALIAS to point mycollection at
> mycollection_2.
> At that point, anybody using mycollection will start working with
> mycollection_2.
>
> Meanywhile, mycollection_1 is still addressable (presumably by the back end) by
> addressing it explicitly rather than through an alias. It has _not_ been changed
> in any way by creating the new alias.
>
> Best,
> Erick
>
> On Mon, May 30, 2016 at 11:15 PM, Derek Poh <dp...@globalsources.com> wrote:
>> Hi Erick
>>
>> Thank you for pointing out the sort behaviour of numbers in a string field.
>> I did not think of that. Will use float.
>>
>> Would like to know how would you guys handle the usage of collection alias
>> in my case.
>> I have a 'product' collectionand Icreate a new collection'product_tmp' for
>> this field type change and index into it. I create an alias 'product' on
>> this new 'product_tmp' collection.
>> IfI were to index to or delete documents from the 'product' collection, SOLR
>> will index on and delete from 'product_tmp' collection, am I right?
>> That means the 'product' collection cannot be usedanymore?
>> Even if I were to create an alias 'product_old' on 'product'
>> collection;issue a delete all documents or index on 'product_old', SOLR will
>> delete or index on 'product_tmp' collection instead?
>>
>> My intention is to avoid having to updatethe clients serversto point to
>> 'product_tmp' collection.
>>
>>
>> On 5/31/2016 10:57 AM, Erick Erickson wrote:
>>> 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 <dp...@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.
>>>
>>
>> ----------------------
>> 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.