Open Huyeng opened 7 years ago
Then, when the users remove the keywords for search box, the topic filter should be updated automatically to show all without entering.
@huyeng the current implementation of the search page does not have any AJAX-like mechanisms to update the search results without refreshing/reloading the page.
This makes it difficult to implement what you are requesting here. The only solution I can think of is to trigger the submit action on the form when the users remove all characters from the search field, but that would be weird UX and they would ask themselves why the page is reloading automatically.
As a rule of thumb, every new search will trigger a page reload and we should implement the best UX possible while coping with this fact.
@acorbi - just make it to be simple. Using the jQuery to update the topic filter, when the keywords from the textbox is removed. It means that no need to update the result of searching. The result will be updated when the users add new keywords or choose the topic.
@Huyeng that would not work that well, the list of available topics is generated out of the available contents on the search index, which is changing constantly.
Can we set the default values of the topic filter? And then show those default value of topic if keyword empty. I'm not sure if it is possible or not?
Anyways, this issue requires to fix, so we need to find the way to fix this.
On searching result page, the items of topic filter will be listed based on the finding result. However, when the keyword is cleared, the topic filter should list all the main categories for users selects if they would like to search something by category. For example, if the users search "Urban Area", there are about 4 category listed on the topic filter. Result page: https://pp.opendevelopmentcambodia.net/?type=dataset&s=Urban+Areas+&taxonomy=all&metadata_created=all&sorting=score
Then, when the users remove the keywords for search box, the topic filter should be updated automatically to show all without entering.
From my observing during ODC workshop, this is very important on the Khmer site because some users are lazy to type the Khmer keywords and some don't know how to type it, and they prefer to chose the topic for searching some cases.