Tag search improvements
We have a proposal (me and @ebarry) to make the typeahead search primarily tag search, the way it is on https://publiclab.org/tags, and have the full page search be where you get content and people results (see https://github.com/publiclab/plots2/issues/5708 as well!)
Parts of this:
- [ ] Adding related terms for exact matches: if you enter "coqui" and there's a
coquitag, AND there are not many other results (<3) we add in related tags (pending #5715 tests) usingTag.related('coqui') - [x] need to address hyphens - just replace spaces with hyphens when you initiate the search? edge cases?
- [x] #5708 shows tag search results along top of ALL search results pages, rather than in its own results page. This is nice!
- [ ] should we /not/ show powertags in these results?
Here's where we could insert extra "related" tag results if there are very few results:
https://github.com/publiclab/plots2/blob/7f7c88e2f05ae19b409b8388f497a0ec8bd9c7fb/app/api/srch/search.rb#L272-L290
Noting that tag search uses this path: https://publiclab.org/tag/suggested/balloon
https://github.com/publiclab/plots2/blob/d55c716621d8072d0ffcd51b46c6b2b240ce5f4d/app/controllers/tag_controller.rb#L376-L391
Also https://github.com/publiclab/plots2/issues/5951
What's yet to be done on this issue?
Is this issue still open? If so can u assign it to me?
Hi! We just need to add "pinned" notes to the top of the search results, kind of similarly to how this was implemented: https://github.com/publiclab/plots2/pull/6423/
We'd love your help, but this is a bit complex -- if it's your first time maybe you'd like to try a smaller issue first?
But, apart from that, I think possibly the remainder of these issues might not be worth implementing -- @ebarry what do you think?
Thanks, all!
I agree, since we are no longer writing our own custom search, let's narrow this issue as Jeff suggests to adding "pinned" content (could be note OR wiki FYI) curated by site administrators to accompany search results.
<% @pinned_nodes = NodeShared.pinned_nodes(params[:id]) %>
<% if @pinned_nodes.length > 0 %>
<div class="alert alert-warning">
<i class="fa fa-thumb-tack"></i>
<a href="<%= @pinned_nodes.first.path %>"><b><%= @pinned_nodes.first.title %></b></a>
<i class="pull-right"><small>featured result</i></small>
</div>
<% end %>