python - How do we update a indexed document using the whoosh module when we have some fields that are not stored? -
schema(title=text(analyzer=stem_ana, stored=true), content=text(analyzer=stem_ana, vector=true), link=id(stored=true), meta=text(analyzer=stem_ana), path=id(stored=true), scores=id(stored=true), clicks=numeric(stored=true), file_name=id(unique=true) ) i unable retrieve field content=text(analyzer=stem_ana, vector=true)
i wan't update content of clicks without altering other fields, how should it? have no clue how retrieve contents of fields not stored.
whoosh can't update indexed documents "in place" (just imagine 1 field got longer...).
so, you'ld retrieve document whoosh index (it include stored fields). if have fields not stored whoosh kept elsewhere, you'ld need retrieve them these other places , add them document again.
then call update_document(**fields) - whoosh use unique fields remove old indexed documents have same values in these fields , index new document.
Comments
Post a Comment