tantivy-py icon indicating copy to clipboard operation
tantivy-py copied to clipboard

Add delete-by-query and deprecate delete_documents. fix #432 and #297

Open cjrh opened this issue 9 months ago • 0 comments

Quick recap: we're trying to solve the very confusing problem of delete_documents(<field>, <value>) not applying query parsing rules like tokenization to <value>. This is a bit of a footgun currently so we need to improve the dev experience here.

Based on my earlier work and thinking in #435, I think this is the best way to go:

  1. Add a new method delete_documents_by_query(), which exposes the delete_query method from tantivy
  2. Add a new method name delete_documents_by_term, which does the same things as what delete_documents used to do.
  3. Retain delete_documents(), but make it a wrapper that calls delete_documents_by_term and put a deprecation notice on the wrapper. Then we can look at removing the wrapper in a future version.

cjrh avatar Mar 23 '25 23:03 cjrh