[GeoNode-users] text search question

Simone Dalmasso simone.dalmasso at gmail.com
Wed Aug 26 23:13:02 PDT 2015


Hi, if you are referring to the thext search box on the left part of the
search pages then you need to make sure that the api supports the filtering
that you need, see
 https://github.com/GeoNode/geonode/blob/master/geonode/api/resourcebase_api.py#L44
<https://github.com/GeoNode/geonode/blob/master/geonode/api/resourcebase_api.py#L44>
,

then add the html part, templates are here
https://github.com/GeoNode/geonode/tree/master/geonode/templates/search,

then add the logic for the search that is in this file,
https://github.com/GeoNode/geonode/blob/master/geonode/static/geonode/js/search/search.js.
Here, depending on the type of filter that you need, the logic may vary but
if you want to apply a filter similar to the text one then see this part of
the file
https://github.com/GeoNode/geonode/blob/master/geonode/static/geonode/js/search/search.js#L369.
Autocomplete is used for the autosuggestion when typing, the search is done
by appending "title__contains=keyword" to the $scope.query and then trigger
the query_api function.

If you want to change the behavior of the top page search bar then is you
have to modify the html in base.html
https://github.com/GeoNode/geonode/blob/master/geonode/templates/base.html#L74,
but that is a pure html form.

Hope this helps

2015-08-27 7:38 GMT+02:00 Häfliger Guido <guido.haefliger at vogelwarte.ch>:

> Hello
>
> We test geonode to manage our metadata (version 2.4b25). Is it possible to
> extend the text search to other attribute fields? For the moment the text
> search only use the layer name. If it is possible, where can I configure it?
>
> Regards
> Guido
>
> ____________________________________________________
>
> Dipl. Ing. ETH Guido Häfliger
> EDV/GIS-Spezialist
> Tel. ++41 41 462 97 60
>
> *guido.haefliger at vogelwarte.ch <guido.haefliger at vogelwarte.ch> *
>
> *www.vogelwarte.ch <http://www.vogelwarte.ch> *Schweizerische Vogelwarte
> | Seerose 1 | CH-6204 Sempach | Schweiz
>
>
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>
>


-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20150827/0c179f4a/attachment.html>


More information about the geonode-users mailing list