Changing precisionStep without a re-index

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

Changing precisionStep without a re-index

Michael Ryan
Is it safe to change the precisionStep for a TrieField without doing a re-index?

Specifically, I want to change a field from this:
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
to this:
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>

By "safe", I mean that searches will return the correct results, a FieldCache on the field will still work, clowns won't eat me...

-Michael
Reply | Threaded
Open this post in threaded view
|

Re: Changing precisionStep without a re-index

Yonik Seeley-2-2
On Mon, Apr 16, 2012 at 12:12 PM, Michael Ryan <[hidden email]> wrote:
> Is it safe to change the precisionStep for a TrieField without doing a re-index?

Not really - it changes what tokens are indexed for them numbers and
range queries won't work correctly.
Sorting (FieldCache), function queries, etc, would still work, and
exact match queries would still work.


-Yonik
lucenerevolution.com - Lucene/Solr Open Source Search Conference.
Boston May 7-10


> Specifically, I want to change a field from this:
> <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
> to this:
> <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
>
> By "safe", I mean that searches will return the correct results, a FieldCache on the field will still work, clowns won't eat me...
>
> -Michael
Reply | Threaded
Open this post in threaded view
|

RE: Changing precisionStep without a re-index

Michael Ryan
> Not really - it changes what tokens are indexed for them numbers and
> range queries won't work correctly.
> Sorting (FieldCache), function queries, etc, would still work, and
> exact match queries would still work.

Thanks. So it is just range queries that won't work correctly? That's okay for my purposes.

-Michael
Reply | Threaded
Open this post in threaded view
|

RE: Changing precisionStep without a re-index

Michael Ryan
In case anyone tries to do this... If you facet on a TrieField and change the precisionStep to 0, you'll need to re-index. Changing precisionStep to 0 changes the prefix returned by TrieField.getMainValuePrefix(FieldType), which then causes facets with a value of "0" to be returned.

-Michael