<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi together,<div class=""><br class=""></div><div class="">this might be an easy one. In geonode 2.4 I have extended autocomplete registry to search in more fields</div><div class="">on layers left side title-search-input.</div><div class=""><br class=""></div><div class=""><a href="https://github.com/GeoNode/geonode/blob/2.4.x/geonode/base/autocomplete_light_registry.py" class="">https://github.com/GeoNode/geonode/blob/2.4.x/geonode/base/autocomplete_light_registry.py</a></div><div class=""><br class=""></div><div class=""><div class="">autocomplete_light.register(ResourceBase,</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>search_fields=<b class="">[‘title‘,’abstract’,’purpose'],</b></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>autocomplete_js_attributes={'placeholder': 'Resource name..', },)</div></div><div class=""><br class=""></div><div class="">then changed the base model to return abstract and purpose content as well:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/GeoNode/geonode/blob/2.4.x/geonode/base/models.py#L342" class="">https://github.com/GeoNode/geonode/blob/2.4.x/geonode/base/models.py#L342</a></div><div class=""><div class=""> def __unicode__(self):</div><div class=""> return self.title + ’,’ + self.abstract + ’,’ + self.purpose</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The result is a user can search f.e. for ‚dog‘ and autocomplete shows choices like:</div><div class=""><b class="">Dog Title, Dogs Heaven, the purpose is sleep</b></div><div class=""><b class="">Dogs world, Dogs Hell, the purpose is eat</b></div><div class=""><b class=""><br class=""></b></div><div class="">All that is missing is that I do not want to show a field when the search term is not</div><div class="">found in it. F.e. if purpose does not has ‚dog‘ autoselect should not show it.</div><div class=""><div class=""><b class="">Dog Title, Dogs Heaven</b></div></div><div class=""><b class="">…</b></div><div class=""><b class=""><br class=""></b></div><div class="">From the documentation of DAL I assumed that the way to go is to create/register a subclass like:</div><div class=""><br class=""></div><div class=""><div class="">class CustomResource(autocomplete_light.AutocompleteModelBase):</div><div class=""> search_fields = ['title', ‚abstract‘,’purpose']</div><div class=""> model = ResourceBase</div><div class=""><br class=""></div><div class="">autocomplete_light.register(CustomResource)</div></div><div class=""><br class=""></div><div class="">and override the httpResponse method. Unfortunately this basic step already ends in a 404.</div><div class="">Maybe one could bring me on the right track how to achieve filtering the return.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Toni</div></body></html>