9

I have a site with ~ 25000 entries, and around 130 custom fields. I tried to rebuild the search index and it didn't complete after 8hours of running none stop. Whilst I'm sure this can be blamed on the Server to some degree, I can see that my search index table has just short of 700000 rows, which I'm guessing takes a reasonable amount of time to create.

I was sure that I'd seen somewhere a way to hide/exclude fields from the search index, but looking now I can't find anyway to omit specific fields from the search index, which I would expect to reduce the load on the search indexer, there are only very few fields that I actually want the system to actually search by so I'm hoping there's a solution to this, I can reduce the load on the server and speed up the reindexing.

Thanks

  • I'm keen to see if there is a solution to this too ... I have an index with upwards of 2.5m rows currently and am terrified of rebuilding it just in case it never completes. Not that I think it needs it as the element API takes care of updating it but still - housekeeping! – Josh Angell Jan 14 '16 at 10:07
5

As of Craft 3, there is a RegisterElementSearchableAttributesEvent event that a plugin can listen to to change modify what gets saved to the search index table when an element is saved.

|improve this answer|||||
  • 2
    Thanks I have done :) feedback.craftcms.com/forums/285221-feature-requests/… – dave_agilepixel Feb 1 '16 at 14:41
  • I had big issues on a Craft 2 multilingual site with dozens of thousands of entries with Matrix fields. The site had become extremely slow (almost unusable), especially when recording new data. This was certainly caused by the searchindex table with massive records. I am currently working on a Craft 3 site using PostgreSQL and fear the same kind of issues. Has the situation changed since this post? Is there finally a way to exclude fields from the search index? – Romain Poirier Oct 16 '18 at 9:52
  • @RomainPoirier Updated answer. – Brad Bell Oct 16 '18 at 17:10
  • Thank you @BradBell. But are you sure that this new Event can set fields to ignore by the search index? I'm stuck here. – Romain Poirier Oct 18 '18 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.