FAQ
I have an existing index which was created with DefaultSimilarity. I
want to update the index to use my own Similarity class (need to change
the lengthNorm). I wrote a quick script which creates a new index,
calls setSimilarity(new MySimilarity) for that indexes IndexWriter, and
then calls writer.addIndexes(Directory[] dirList) where dirList contains
my previously existing index.

Initially, I had anticipated that doing this would updated the
Similarity as part of the add process. But after running some tests,
this does not appear to be the case.

Is there some way I can update the Similarity on an index without having
to query out each document, and re-indexing in a new index?

Thanks,

Shane

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

Search Discussions

  • Chris Hostetter at Oct 2, 2006 at 9:42 pm
    : Initially, I had anticipated that doing this would updated the
    : Similarity as part of the add process. But after running some tests,
    : this does not appear to be the case.

    fieldNorms are computed when the document is added to the index ...
    merging indexes doesn't affect them.

    : Is there some way I can update the Similarity on an index without having
    : to query out each document, and re-indexing in a new index?

    http://lucene.apache.org/java/docs/api/org/apache/lucene/misc/LengthNormModifier.html

    ...but note the NOTE in the javadocs...

    NOTE: This only works if you do not use field/document boosts in your index.

    -Hoss


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedOct 2, '06 at 8:48p
activeOct 2, '06 at 9:42p
posts2
users2
websitelucene.apache.org

2 users in discussion

Shane Perry: 1 post Chris Hostetter: 1 post

People

Translate

site design / logo © 2022 Grokbase