Issue #244 resolved

optimize cause dynamic fields to be deleted

nickjenkin
created an issue

Hi When performing a writer.commit(optimize=True) all the dynamic fields appear to be getting removed from the index.

I have attached a script which replicates the error.

Thanks -Nick

Comments (7)

  1. Matt Chaput repo owner

    fix optimize() and *MpWriter to keep dynamic fields, fixes #244 (now really :)

    I decided to change Schema.names a litte (in a backwards compatible way): It now supports an optional check_names param to support checking for dynamic field names.

    Whoosh had at 2 places issues with this (both fixed by this changeset), because the old .names() was called without considering that there might be dynamic field names also.

    We maybe should consider making check_names a mandatory parameter, that would maybe avoid such mistakes, but it would be backwards incompatible.

    I also refactored the code a little, to make both affected places a litte more similar.

    I tested with nosetests and the test supplied by the author of issue #244, all succeeding now.

    85763242c97a

  2. Log in to comment