<p>I noticed that search (both on the public website and in the entries admin area) was not searching a given field.  I checked the field  and noticed that the &quot;Use this field's values as search keywords&quot; was unchecked.  I checked it.  I then opened and saved one entry and searched again.  That entry now appeared in the search results, though others did not.</p>
<p>Rather than manually open and save each of thousands of entries, I exported the database, imported it into a local database and ran the console command php craft resave/entries --update-search-index.  All entries now appeared in local searches.</p>
<p>I then exported the database from the local environment and imported the database into production.  I was surprised to discover that the field was not being searched in production.</p>
<p>Things I checked:</p>
<ol>
<li>Yes, the exported database is live in production.</li>
<li>Yes, the field is currently selected for searching in production.</li>
<li>Yes, the craft_searchindex table in local and production have the same number of rows.</li>
</ol>

CC BY-SA 4.0
2022-09-21T18:37:49.070Z
1. Are you able to manually `craft resave/entries --update-search-index` in production? (If so, any change in behavior?)
2. Any differences (database engine version, character sets, etc.) between the running database in each environment?
Matt Stein
CC BY-SA 4.0
2022-09-21T18:53:07.257Z
1.  Unfortunately, no.  2. Yes.  Prod is several versions of MYSQL behind and uses a different charset. However, all other searches seem to return the same results.
vlasits
CC BY-SA 4.0
2022-09-22T23:46:22.270Z
If this is something you can reproduce easily in another production environment (Digital Ocean droplet, etc.), you may want to write support@craftcms.com about it and provide a database dump.
Matt Stein
<craft3><search>
Search query working locally, but not in production
# Search query working locally, but not in production

(Asked by: username_0 on 2022-09-21)

I noticed that search (both on the public website and in the entries admin area) was not searching a given field. I checked the field and noticed that the "Use this field's values as search keywords" was unchecked. I checked it. I then opened and saved one entry and searched again. That entry now appeared in the search results, though others did not.

Rather than manually open and save each of thousands of entries, I exported the database, imported it into a local database and ran the console command php craft resave/entries --update-search-index. All entries now appeared in local searches.

I then exported the database from the local environment and imported the database into production. I was surprised to discover that the field was not being searched in production.

Things I checked:

1. Yes, the exported database is live in production.
2. Yes, the field is currently selected for searching in production.
3. Yes, the craft\_searchindex table in local and production have the same number of rows.

**Tags:** craft3, search

> **Comments:**
> **username_1**: 1. Are you able to manually `craft resave/entries --update-search-index` in production? (If so, any change in behavior?) 2. Any differences (database engine version, character sets, etc.) between the running database in each environment?  
> **username_0**: 1.  Unfortunately, no.  2. Yes.  Prod is several versions of MYSQL behind and uses a different charset. However, all other searches seem to return the same results.  
> **username_1**: If this is something you can reproduce easily in another production environment (Digital Ocean droplet, etc.), you may want to write support@craftcms.com about it and provide a database dump.  

---

## 0 answers

