Global search not working EPPNext v12

Global search not working.

I’m using:
ERPNext: v12.3.1 (version-12)
Frappe Framework: v12.1.0 (version-12)

bench rebuild-global-search not taking effect.

Item name and Item code in Global Search

Anyone have this issue too?

ERPNext: v12.3.1 (version-12)
Frappe Framework: v12.1.0 (version-12)

Global search seems to be working for Items. Does it work for other doctypes, Customer for example? Does it work for items that appear in transactions like Purchase Orders or Quotations?

Also not working for customers.

Working only for Contacts…

Is the Iten Name indexed?

Yes.

In the Item doctype , View Settings - are they like these?

Yes. I didn’t change anything neither on Customer nor Item Doctype.

Apparently there is a bench rebuild-global-index command, have you tried that?

bench rebuild-global-index
Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: No such command “rebuild-global-index”.

bench rebuild-global-search Not taking effect, as I wrote in first topic.

I have this issue https://github.com/frappe/frappe/issues/8779 and I used quick fix like issue creator proposed, cause I had fatal error when trying to rebuild.

Is this a new installation of Erpnext with newly entered data, or has it been in use for some time , upgraded from v11? At what point did global search stop working?

If you go into bench mariadb and try: show indexes from tabItem ; do indexes list?

I don’t know exactly when it was stop working. I used v11 for some time and updated to v12.

MariaDB [1bd3e0294da19198]> show indexes from tabItem;
±--------±-----------±------------------------±-------------±------------------------±----------±------------±---------±-------±-----±-----------±--------±--------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
±--------±-----------±------------------------±-------------±------------------------±----------±------------±---------±-------±-----±-----------±--------±--------------+
| tabItem | 0 | PRIMARY | 1 | name | A | 1916 | NULL | NULL | | BTREE | | |
| tabItem | 0 | item_code | 1 | item_code | A | 1916 | NULL | NULL | YES | BTREE | | |
| tabItem | 0 | hub_sync_id | 1 | hub_sync_id | A | 2 | NULL | NULL | YES | BTREE | | |
| tabItem | 1 | item_name | 1 | item_name | A | 1916 | NULL | NULL | YES | BTREE | | |
| tabItem | 1 | item_group | 1 | item_group | A | 83 | NULL | NULL | YES | BTREE | | |
| tabItem | 1 | variant_of | 1 | variant_of | A | 4 | NULL | NULL | YES | BTREE | | |
| tabItem | 1 | parent | 1 | parent | A | 2 | NULL | NULL | YES | BTREE | | |
| tabItem | 1 | modified | 1 | modified | A | 1916 | NULL | NULL | YES | BTREE | | |
| tabItem | 1 | show_in_website | 1 | show_in_website | A | 4 | NULL | NULL | | BTREE | | |
| tabItem | 1 | show_variant_in_website | 1 | show_variant_in_website | A | 2 | NULL | NULL | | BTREE | | |
| tabItem | 1 | route_index | 1 | route | A | 24 | 500 | NULL | YES | BTREE | | |
±--------±-----------±------------------------±-------------±------------------------±----------±------------±---------±-------±-----±-----------±--------±--------------+
11 rows in set (0.001 sec)

Anyone has this issue too?

Global search is built via background jobs. Check for error logs

I don’t have error logs about this.

When I type bench rebuild-global-search command I have:
Rebuilding Global Search : [========================================]
frappe@ip-xxx-xxx:~/frappe-bench$

And nothing in error log

I restore backup of database on fresh bitnami erpnext image and global search still not working. Maybe problem in database, not code?

“Global search is built via background jobs. Check for error logs”

Not that log, rmehta probably refers to this log - you should expect to see entries like these at set intervals:

frappe@ubuntu:~/frappe-bench$ find logs/ -name '*.log' | xargs grep 'frappe.utils.global_search.sync_global_search'
logs/worker.error.log:11:24:36 short: frappe.utils.background_jobs.execute_job(event=u'all', is_async=True, job_name=u'frappe.utils.global_search.sync_global_search', kwargs={}, method=u'frappe.utils.global_search.sync_global_search', site=u'example.com', user=u'Administrator') (6c8c9d0c-26ba-48f2-9669-1f2b331f730a)
logs/worker.error.log:11:28:37 short: frappe.utils.background_jobs.execute_job(event=u'all', is_async=True, job_name=u'frappe.utils.global_search.sync_global_search', kwargs={}, method=u'frappe.utils.global_search.sync_global_search', site=u'example.com', user=u'Administrator') (e6ddd691-790b-4870-b88f-39bffda79d89)
logs/worker.error.log:11:32:37 short: frappe.utils.background_jobs.execute_job(event=u'all', is_async=True, job_name=u'frappe.utils.global_search.sync_global_search', kwargs={}, method=u'frappe.utils.global_search.sync_global_search', site=u'example.com', user=u'Administrator') (0019cf4d-56af-45af-b623-0560cd796fd7)

Yes. I have a lot of messages like this.

logs/worker.error.log:19:52:50 short: frappe.utils.background_jobs.execute_job(event=u'all', is_async=True, job_name=u'frappe.utils.global_search.sync_global_search', kwargs={}, method=u'frappe.utils.global_search.sync_global_search', site=u'xxx', user=u'Administrator') (e6c5564c-408d-4995-b38c-ca5cddf15a7b)

logs/worker.error.log:19:56:50 short: frappe.utils.background_jobs.execute_job(event=u'all', is_async=True, job_name=u'frappe.utils.global_search.sync_global_search', kwargs={}, method=u'frappe.utils.global_search.sync_global_search', site=u'xxx', user=u'Administrator') (dab99da5-8f40-4218-a6fb-d80848fcd256)

logs/worker.error.log:20:00:51 short: frappe.utils.background_jobs.execute_job(event=u'all', is_async=True, job_name=u'frappe.utils.global_search.sync_global_search', kwargs={}, method=u'frappe.utils.global_search.sync_global_search', site=u'xxx', user=u'Administrator') (df6f53fc-642d-4143-abba-d78de3be92bb)

The problem was in “Global Search Settings”

https://{Your domain}/desk#Form/Global%20Search%20Settings/Global%20Search%20Settings

There were missing almost all doctypes that I was need. But I didn’t use this settings at all.

I pressed to “Reset button” and now everything is okay. Thanks all for help.

1 Like