etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 129 forks source link

Remove deleted objects when rebuilding index #288

Closed CristopherH95 closed 2 years ago

CristopherH95 commented 2 years ago

Hello! This contribution is meant to resolve #276. In order to accomplish this, the following is added:

CristopherH95 commented 2 years ago

Strangely enough, I have been unable to replicate the error reported in the build locally. I will have to dive deeper into this to fix the build error.

etianen commented 2 years ago

Hi,

Thank for this MR! It looks great, and I appreciate the test for the new feature. :)

If you can figure out the build error, I'd be very happy to merge this. I can't see anything obvious that would be causing it. Hopefully you're figure it out!

CristopherH95 commented 2 years ago

Build errors have been fixed! The issue was a bug in some versions of Django which generates invalid SQL when attempting to use Cast. I added a function get_pk_output_field which wraps some logic to avoid this error. This is the bug for reference: https://code.djangoproject.com/ticket/28371.

etianen commented 2 years ago

This is excellent, and thanks for chasing down the bug! I'll push out a new watson release next week.

etianen commented 2 years ago

Release 1.6.0 has landed :)