You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are a large number of entities in EATS, adding a new entity relationship is quite unwieldy, as typing text into the Related Entity field displays a large number of approximate matches. Can this just display exact matches as the user types?
The text was updated successfully, but these errors were encountered:
Another tricky one, as the inexact matching is often going to be useful. Perhaps some way of toggling between the two behaviours?
To make the change in your specific case, modify eats_topic_map.py so that lookup_entities takes a new Boolean argument specifying whether an exact match is wanted, and have lookups.py's get_query method pass in True. In lookup_entities, pass the Boolean through to _create_lookup_query and use it to vary between the existing istartswith query term and iexact.
So, something like:
def _create_lookup_query (self, name, is_exact):
query = None
name_forms = create_name_forms(unicode(name))
for name_form in name_forms:
if query is None:
if is_exact:
query = Q(indexed_names__form__iexact=name_form)
else:
query = Q(indexed_names__form__istartswith=name_form)
else:
if is_exact:
query = query | Q(indexed_names__form__iexact=name_form)
else:
query = query | Q(indexed_names__form__istartswith=name_form)
return query
When there are a large number of entities in EATS, adding a new entity relationship is quite unwieldy, as typing text into the Related Entity field displays a large number of approximate matches. Can this just display exact matches as the user types?
The text was updated successfully, but these errors were encountered: