fix: global search index breaking on long titles
fix: global search index breaking on long titles

If you created a doc with a title longer than 140 characters, it's supposed to be truncated to 140.

However, the global search index would break for that doctype due to an error in the query.

The truncate was happening AFTER it was escaped, causing it to lose the closing quote mark which caused a SQL error and broke the index.
frappe/frappe,saurabh6790/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,yashodhank/frappe,yashodhank/frappe,mhbu50/frappe,frappe/frappe,adityahase/frappe,saurabh6790/frappe,mhbu50/frappe,adityahase/frappe,StrellaGroup/frappe,StrellaGroup/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,adityahase/frappe,StrellaGroup/frappe,mhbu50/frappe,yashodhank/frappe,adityahase/frappe,saurabh6790/frappe,mhbu50/frappe,frappe/frappe,yashodhank/frappe,saurabh6790/frappe