Sylius search not working after a product is added in v0.12

While still trying to grok Sylius, I noticed that the search feature to find newly added products doesn’t work? I tried via the administration backend, both locally on the vagrant provided set up and on demo.sylius.org as well as writing my own import script using the ProductBuilder but to no avail.

When looking at the code, I could see that searches are against the sylius_search_index database table but when I looked in there I couldn’t see any new product entries, only those provided when loading the fixtures. As for how this database table gets populated, I found that a listener is fired and rules checked before an entry is added. From here, it turns out that this OrmListener invokes a rule check to see if the given object being written to the database is indexable, and this is where it falls over.

Continue reading