-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full Text Search and Unit Tests #655
Comments
Yes, InnoDB doesn't make changes to full text indexes until commits. You can use |
Also, this issue tracker is not really a support service. Your issue does not relate to the library. Please constrain your support questions to support forums like Stack Overflow in future. |
Thank you @adamchainz I found what you are referring to in the innodb docs fulltext docs here.
Do you have any plans to support FULLTEXT index and |
Summary
Manually implementation of FULLTEXT search support returns empty queryset when using Django TestCase.
My apologies in advance as this is likely not a bug, but I have been stuck on this for a while and was not able to get help on StackOverflow, Reddit, and Django Mailing list.
You are my last hope 🙏
My Stackoverflow question has all the details, but here is a summary:
I added a
__search
lookup and FULLTEXT index manually to allow full text search:The code above works perfectly - the index is created, and search mysql fulltext boolean actually works as expected.
The issue is testing. When I tried to write tests,
__search
always returns an empty queryset.I actually noticed if I use
unittest.TestCase
instead ofdjango.test.TestCase
the test passes - could this be related to how django's test case wraps db transactions?Once again, thank you for any help and apologies for asking a question here.
Hopefully this could help others in the future trying to implement FULLTEXT search themselves!
The text was updated successfully, but these errors were encountered: