Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search functionality no longer works on people/groups #2555

Closed
sarasafavi opened this issue Jul 19, 2016 · 6 comments
Closed

Search functionality no longer works on people/groups #2555

sarasafavi opened this issue Jul 19, 2016 · 6 comments
Milestone

Comments

@sarasafavi
Copy link
Contributor

Search only searches layers, maps, and documents -- should also search across people & groups

@BerryDaniel BerryDaniel added this to the 2.5 milestone Jul 19, 2016
@sarasafavi
Copy link
Contributor Author

Can't assign to myself: working this now

@artists974
Copy link
Contributor

Maybe it doesn't work because of

  • this part in search_scripts.html :

    {% get_context_resourcetype as pathc %}
    {% if pathc == "layers" %}
    AUTOCOMPLETE_URL_RESOURCEBASE = '{% url "autocomplete_light_autocomplete" "LayerAutocomplete" %}';
    {% elif pathc == "maps" %}
    AUTOCOMPLETE_URL_RESOURCEBASE = '{% url "autocomplete_light_autocomplete" "MapAutocomplete" %}';
    {% elif pathc == "documents" %}
    AUTOCOMPLETE_URL_RESOURCEBASE = '{% url "autocomplete_light_autocomplete" "DocumentAutocomplete" %}';
    {% elif pathc == "search" %}
    AUTOCOMPLETE_URL_RESOURCEBASE = '{% url "autocomplete_light_autocomplete" "ResourceBaseAutocomplete" %}';
    {% else %}
    AUTOCOMPLETE_URL_RESOURCEBASE = '{% url "autocomplete_light_autocomplete" "ResourceBaseAutocomplete" %}'; // AR - Comment : This line is the original configuration for Geonode's search bar display results.
    {% endif %}

Which only works for Layers, Documents and Maps. Must be necessary to add People and Groups.

  • Also I think it is necessary to add People and Groups in this function, in base_tags.py :

def get_context_resourcetype(context):

  • Also add this class in People and Groups' autocomplete_light_registry.py (check how autocomplete_light_registry.py is filled for Layers, Maps and Documents) :

class PeopleAutocomplete(autocomplete_light.AutocompleteModelTemplate):
choice_template = 'autocomplete_response.html'
class GroupAutocomplete(autocomplete_light.AutocompleteModelTemplate):
choice_template = 'autocomplete_response.html'

With these modifications, I think this should work.

@sarasafavi
Copy link
Contributor Author

sarasafavi commented Aug 15, 2016

@artists974 so those fixes mostly work to add People/Groups back into DAL config (so that people/group autocomplete results show up after typing in the header's search box). Ref #2582 for a proposed patch that does that.

However, this doesn't fix search itself. I originally was told that profile/group search functionality used to exist (and therefore assumed this was a regression), but on further review I don't believe this has been the case for at least a long while. Currently, the search bar (in header) functions as an omni-search, across all ResourceBase-type content: layers, maps, and documents. This does not include people or groups, apparently by design, as they are not ResourceBase types. Unfortunately without comments/docs I can't say for sure what the original dev intention was here. :)

There are a couple options for adding search over people & groups:

  1. Kill the omni-search functionality, and make search instead context-dependent: e.g., if you are viewing /layers, using the search bar will search only layers. Apart from potential downstream-user-issues, this seems like suboptimal UX so I don't really favor this solution.
  2. Retain omni-search functionality, and completely revamp the schemas for people & groups (making them also ResourceBase objects). This is also less than great IMO, at very least as a backwards-incompatibility issue for existing users/dbs.
  3. Keep omni-search as-is: UX-wise it makes sense to be searching only actual content (layers, maps, documents) from the header. We can amend the hint text in the search box to make this clearer if desired. For searching people & groups, we then add a context-specific search within the /people & /groups pages themselves.

If the community agrees, I'll go ahead and implement option 3. Thoughts?

@jj0hns0n
Copy link
Member

+1 on implementing option 3. @sarasafavi can we look at this during the sprint?

@sarasafavi
Copy link
Contributor Author

@jj0hns0n in-progress, should be able to raise PR today

@sarasafavi
Copy link
Contributor Author

sarasafavi commented Aug 22, 2016

@jj0hns0n PR raised #2597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants