TransWikia.com

Inconsistent search results in multi-site setup (prod/stage)

Craft CMS Asked by Crafty Cat on October 26, 2020

I have set up a staging site alongside production just like the docs describe (Craft Solo 3.4.24). I have copied the "Site Settings" for all sections and set the "Propagation Method" to "Save entries to all sites enabled for this section".

Because Craft had trouble replicating all entries in one queue job I did this manually via CLI using ./craft resave/entries --type=<type> and ./craft resave/entries --section=<section>. This worked beautifully.

But I have an issue with the site search. Locally, when I search e.g. for ‘citizen’, I get the expected results (count is 60). Same on production. But on stage I get only 2 results back.

When I add .site('*') to the query in Twig I get 120 results back, so the staging site does have all entries.

It appears as if the search index on stage is not complete? Is there anything I can do to refresh it?

Thank you!

One Answer

The resave/entries command has an optional parameter to rebuild the search indices - may be worth a shot:

./craft resave/entries --update-search-index

https://craftcms.com/docs/3.x/searching.html#rebuilding-your-search-indexes

Correct answer by James Smith on October 26, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP