On 6/13/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
>> :
>> : Actually, it's not quite equivalent if there was a schema change.
>> : There are some "sticky" field properties that are per-segment global.
>> : For example, if you added omitNorms="true" to a field, then did
>>
>> Hmmm... I thought the optimize would take care of that?
>
> Oh yes, sorry, I was thinking about optimize after you reindexed. If
> you forget to do optimize, you get a different index though...
> definitely spooky stuff to someone not expecting it.
>
Is there an easy way to check if the lucene per/field properties are out
of sync with the solr schema? If so, maybe we should display it on the
admin page.
It would be rare, and give false assurances I think. There are *many*
types of schema changes that we would not be able to detect the
incompatibility. If people have any doubt, they should re-index.
Are there other sticky field properties besides omitNorms?
Yes, this function is what merges the FieldInfo from different
segments (from FieldInfos.java):
public FieldInfo add(String name, boolean isIndexed, boolean storeTermVector,
boolean storePositionWithTermVector, boolean
storeOffsetWithTermVector,
boolean omitNorms, boolean storePayloads) {
FieldInfo fi = fieldInfo(name);
if (fi == null) {
return addInternal(name, isIndexed, storeTermVector,
storePositionWithTermVector, storeOffsetWithTermVector, omitNorms,
storePayloads);
} else {
if (fi.isIndexed != isIndexed) {
fi.isIndexed = true; // once indexed, always index
}
if (fi.storeTermVector != storeTermVector) {
fi.storeTermVector = true; // once vector, always vector
}
if (fi.storePositionWithTermVector != storePositionWithTermVector) {
fi.storePositionWithTermVector = true; // once
vector, always vector
}
if (fi.storeOffsetWithTermVector != storeOffsetWithTermVector) {
fi.storeOffsetWithTermVector = true; // once
vector, always vector
}
if (fi.omitNorms != omitNorms) {
fi.omitNorms = false; // once norms are stored,
always store
}
if (fi.storePayloads != storePayloads) {
fi.storePayloads = true;
}
}
return fi;
}
-Yonik