How do I add custom doctype fields to Global Search?

Want to search a custom doctype from global search like below

Here’s what I’ve tried:

  1. Open the field
    a. Select Index
    b. Select In Global Search
  2. At the bottom of the form, checked Index Web Pages for Search
  3. bench --site my-site rebuild-global-search
  4. bench restart
  5. Reload (clear cache)

Still cant search these custom doctype fields in Global Search. Any clues?

Installed Apps

ERPNext: v14.10.0 (version-14)
Frappe Framework: v14.17.1 (version-14)

Have you tried to add custom doctype in hooks.py file ? As there is a variable called global_search_doctypes

global_search_doctypes = {
    "Default": [
        {"doctype": "CustomDocTypeName", "index": 40},
    ],    
}
1 Like

Thanks for your response I’ll try this. guessing ‘index’ is the field name?

‘Index’ is the not a field name but It’s like the sequence.

1 Like

Like this?

global_search_doctypes = {
	"Default": [
		{"doctype": "Request", "index": 2},
		{"doctype": "Speaker", "index": 3},
	],    
}
bench restart
bench --site my-site rebuild-global-search

Still not getting any results. Did I miss something?

So Frappe 14 has a doctype called Global Search Settings. I simply added my doctypes to it and hit reload.

Thank you for the guidance @Hardik_Zinzu :slight_smile:

1 Like