Commit 1459791e authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Stop iterating asa soon as we find the answer

parent 28febdb6
......@@ -3,8 +3,8 @@ portal = context.getPortalObject()
# This scriptable key supports content_translation if the table is present
catalog = portal.portal_catalog.getSQLCatalog()
if 'content_translation' in getattr(catalog, 'sql_search_tables', []):
if [x for x in getattr(catalog, 'sql_catalog_search_keys', []) if 'Mroonga' in x]:
if 'content_translation' in getattr(catalog, 'sql_search_tables', ()):
if any('Mroonga' in x for x in getattr(catalog, 'sql_catalog_search_keys', ())):
return AndQuery(SimpleQuery(**{'content_translation.translated_text': value, 'comparison_operator': 'mroonga_boolean'}),
Query(**{'content_translation.property_name': 'title'}))
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment