[GeoNode-users] Fwd: Implement the search for GeoNode for title fields, abstract and keywords

Simone Dalmasso simone.dalmasso at gmail.com
Mon Apr 27 23:17:30 PDT 2015


Davi, the abstract seems to work although for the many to many you should
refer to the autocomplete docs, probably you will find something useful
here, http://django-autocomplete-light.readthedocs.org/en/latest/index.html

2015-04-27 18:49 GMT+02:00 Davi Custodio <davicustodio at gmail.com>:

> Simone, I tried to make the main pursuit of GeoNode also sought in the
> abstract field and keywords list. I tried:
>
> *search_fields = ['title', 'abstract', 'keywords'],*
>
> and give an error, since the keywords field is a list of tags ..
>
> also tried to seize the property keyword_csv
>
> *search_fields = ['title', 'abstract', 'keyword_csv']*
>
> but did not work.
>
>
> Can tell me if the search_fields the autocomplete_light clause allows the
> search field type in Many for one? If not, how could I implement this?
>
> Thanks
>
> On Tue, Apr 14, 2015 at 3:58 AM, Simone Dalmasso <
> simone.dalmasso at gmail.com> wrote:
>
>> For the header search is easier since we use autocomplete for it, see
>> this
>> https://github.com/GeoNode/geonode/blob/master/geonode/base/autocomplete_light_registry.py#L11
>> in the left bar of the search engine you could use autocomplete as well
>> for text inputs. If otherwise you need a prepopulated manu as the regions
>> and categories are then you have to do what Paolo suggested and write a
>> custom api and the template and js to support it. See here the apis
>> https://github.com/GeoNode/geonode/blob/master/geonode/api/api.py#L59
>>
>> 2015-04-13 19:50 GMT+02:00 Davi Custodio <davicustodio at gmail.com>:
>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Davi Custodio <davicustodio at gmail.com>
>>> Date: Mon, Apr 13, 2015 at 1:58 PM
>>> Subject: Re: [GeoNode-users] Implement the search for GeoNode for title
>>> fields, abstract and keywords
>>> To: Paolo Corti <pcorti at gmail.com>
>>>
>>>
>>> Paolo, I'm starting to learn Django, so I still have difficulty
>>> identifying some things. In my case, I would have the whole text search
>>> (both on the top bar of the layers, as in the sidebar) was applied in the
>>> title, abstract and keywords. I understand that in the case of key words I
>>> have to implement a for iterating the words to apply the search. But do not
>>> know where exactly (where classes) I should do it.
>>>
>>> Thank you.
>>>
>>> On Mon, Apr 13, 2015 at 10:55 AM, Paolo Corti <pcorti at gmail.com> wrote:
>>>
>>>> Another approach is to keep javascript as it is, and to override the
>>>> GeoNode API in your Django project.
>>>> I have to implement something like you are doing, but for tags
>>>> associated to models not inheriting from ResourceBase.
>>>>
>>>> Therefore, in my urls.py:
>>>>
>>>> api.unregister(geonode_api.TagResource())
>>>> api.register(TagResourceSimple())
>>>>
>>>> where TagResourceSimple is my custom implementation of the Tag API.
>>>> Hope it helps
>>>> p
>>>>
>>>> On Mon, Apr 13, 2015 at 3:17 PM, Simone Dalmasso
>>>> <simone.dalmasso at gmail.com> wrote:
>>>> > Davi, you you want to change the left filter bar behavior then this
>>>> is the
>>>> > place
>>>> >
>>>> https://github.com/GeoNode/geonode/blob/master/geonode/static/geonode/js/search/search.js
>>>> > and this folder for the templates as you are seeing
>>>> >
>>>> https://github.com/GeoNode/geonode/tree/master/geonode/templates/search
>>>> .
>>>> >
>>>> > Don't hesitate to ask!
>>>> >
>>>> > 2015-04-13 15:08 GMT+02:00 Davi Custodio <davicustodio at gmail.com>:
>>>> >>
>>>> >> Hello. I'm trying to customize the GeoNode 2.4 and in other changes,
>>>> i
>>>> >> need to implement the main search find (besides the title field) in
>>>> abstrace
>>>> >> and and keywords fields. I was browsing through all project
>>>> directories, and
>>>> >> could not figure out exactly where I could change this search. I
>>>> realized
>>>> >> that in
>>>> >>
>>>> https://github.com/GeoNode/geonode/tree/master/geonode/templates/search
>>>> >> folder are templates responsible for firing searches using Angular
>>>> JS, but I
>>>> >> could not understand exactly how the whole process works, and this
>>>> would be
>>>> >> the right spot to implement the change.
>>>> >>
>>>> >> Can anyone help?
>>>> >>
>>>> >> Thanks.
>>>> >>
>>>> >> --
>>>> >> Davi de O. Custódio
>>>> >>
>>>> >> _______________________________________________
>>>> >> geonode-users mailing list
>>>> >> geonode-users at lists.osgeo.org
>>>> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>>>> >>
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Simone
>>>> >
>>>> > _______________________________________________
>>>> > geonode-users mailing list
>>>> > geonode-users at lists.osgeo.org
>>>> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> Paolo Corti
>>>> Geospatial software developer
>>>> web: http://www.paolocorti.net
>>>> twitter: @capooti
>>>> skype: capooti
>>>>
>>>
>>>
>>>
>>> --
>>> Davi de O. Custódio
>>>
>>>
>>>
>>> --
>>> Davi de O. Custódio
>>>
>>> _______________________________________________
>>> geonode-users mailing list
>>> geonode-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>>>
>>>
>>
>>
>> --
>> Simone
>>
>
>
>
> --
> Davi de O. Custódio
>



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


More information about the geonode-users mailing list