Searchindex: 100 000 000 rows of freeform submissions in the searchIndex table
What happened?
One of our clients has a multisite website with 5 languages. There are 72 Freeform forms with almost 200 000 submissions in the database.
These 200 000 submissions have created 100 000 000 (one hundred million) rows in the search index table.
It seems that each new submission creates ~1400 rows in the searchindex table. It basically creates a row for each field that exists in freeform for all the 5 languages. So a form that has 4 fields it still creates rows in the searchindex for alot of other fields that are not used by the form.
Errors and Stack Trace (if available)
How can we reproduce this?
Freeform Edition
Pro
Freeform Version
5.11.11
Craft Version
5.8.15
When did this issue start?
- [x] Unsure
- [ ] Fresh install of Freeform
- [ ] After upgrading from older Freeform version
- [ ] After upgrading from older Craft version
- [ ] After a change to hosting configuration
Previous Freeform Version
No response
Hi @ragnarfrosti
Thanks so much for reporting this and for including all the helpful details. We really appreciate the time you took to dig into it.
We've reviewed this internally and it does look like the issue might be related to our defineSearchableAttributes on Submission element type.
We'll plan to include a fix in an upcoming release.
Thanks again for the thorough report! 🙂
This should now be resolved in Freeform 5.13.6+ 🙂
After updating, we also recommend reindexing all submissions with php craft freeform/submissions/reindex.