OSDG-IIITH / www

This repository is the landing page for osdg.iiit.ac.in.
Other
4 stars 16 forks source link

Added search functionality to stories section #38

Closed erilyth closed 8 years ago

erilyth commented 8 years ago

Issue #19, added a simple search which will check if the query string if its a part of a name of a person or an organization and then select the corresponding entries.

mrinaldhar commented 8 years ago

Thank you for the PR! There are a few changes I'd like to recommend, though:

  1. The search should be instant, without requiring the user to press enter. (Show results upto that point while the user is still typing)
  2. It seems to be case sensitive right now. Let's remove that restriction so it's more user friendly.
  3. Upon clearing the search bar, the list of all stories should appear again (and not the last search results)
erilyth commented 8 years ago

I made the appropriate changes, the search now converts entire string to upper case and checks for matches, and on clearing the search bar all the stories appear.

mrinaldhar commented 8 years ago

This works great. One final thing, could you also add searching by tag-name (Like Python, Big data, etc.) functionality?

One way of implementing this would be to put all the tags in a dictionary with the IDs of the results in the corresponding value array to make the search faster.

var foo = { "python": [1,4,5], "big data":[1,5] }      // and similarly for each tag
erilyth commented 8 years ago

I added a tags associated array which would store data as you specified and then in the search I just check if the input's tag is present in any of the projects and I output them.

mrinaldhar commented 8 years ago

Looking good now. Merging.