kobotoolbox / kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
126 stars 170 forks source link

Advanced searchbox #2990

Open magicznyleszek opened 3 years ago

magicznyleszek commented 3 years ago

Description

It was part of the #2293 plan, but we decided it's not MVP.

Screenshot 2021-02-02 at 23 39 08

I wanted to group all the ideas we have about it in one place so it's clear which ones make sense.

  1. It is supposed to work together with the table columns headers. Setting a filter in the table column should be reflected in the searchbox. Something like this: Screenshot 2021-02-02 at 23 59 43
  2. We should make a nice UI that exposes what we already have in search with all magical parent__uid etc.
Ig-Rebollo commented 3 years ago

@magicznyleszek @jnm This is great, I was looking forward to discussing the advanced search (even if it's not MVP and we don't include it in this implementation, in fact, that might be better as it gives us more time to think it through)

The part I find confusing with these ideas is that they mix the search functionality with a filter functionality. In the first mockup I would click on the search box just to find a 'filter' button. Definitely being able to specify where you want to search (i.e. public collections) is very useful, and it could be considered a type of filter, but I think it is important to highlight that this is still a search, not really a filter, otherwise it gets confusing.

If I understood correctly, what you propose would let you indicate not only in which page to search for your keyword (like in public collections) but also in which specific column you want to look into (like language). That would be pretty cool, though it might be challenging to present in a way that is easily understandable.

It might also be a bit misleading, because you are still using keywords after all, so if you tell the search to look into the language column or the public collections table for 'french' and it actually says 'français' then it would yield no results. We would need to provide more flexibility, in case you prefer to look into all columns of the public collections table for example. For instance in your second mockup I would find nothing if I search for french in language, as it uses 'francais', but if I looked in all columns I would've found it, as the name of the template is 'french templ'.

We would also need to think if we want to allow a completely generic search across the site, with no specification on section or page, and what would be the default each time (i.e. the search is by default always set to search in the page you're in, unless you change it)

Let me know if this makes sense and I understood correctly. I can make some quick wireframes to illustrate some of these ideas, and maybe a few diagrams to map the different cases and navigation flows.

magicznyleszek commented 3 years ago

@Ig-Rebollo The first image is probably not the best one. I put it here because it was the only thing we had for the Advanced Search :-D What I had in mind is not a free search withing properties, but rather some way tu put in the search box a search phrase and a set of predefined properties. So if I want to serach for "Farm" collections that are in "Francais (fr)" and tagged "cows", I would type in "Farm", then use some dropdown (or different piece of UI?) where I would find existing languages and tags to choose from. So something more like this, but with all options being dropdowns with options available for given context:

image

So in a way this would move all the functionality from the table headers to some new UI that would be a part of searchbox. Maybe it's not such a good idea to have it do all that :-D

Ig-Rebollo commented 3 years ago

@magicznyleszek I see what you mean. We may have to think through the wording and UI... not sure if that should be called search or filter, or simply 'advanced search'. The button to search is repeated, which might also make it confusing (if I clicked on the top one, the search would not include the advanced search options I selected, or would it?)

I'll give it some thought. I think you're right, if everything is dropdowns to essentially narrow down where you're searching for that keyword, it should be clear enough.

What would happen if you type something and hit enter without selecting anything?