ACM-IGDTUW / Open-Source-Challenge

Advaya'20 The Open Source Challenge
8 stars 30 forks source link

Adding Search button #104

Open yitik-kawatra opened 4 years ago

yitik-kawatra commented 4 years ago

For #93

We can add a search button on the nav bar to search for the events by the event name.

lisa761 commented 4 years ago

Hi, @yitik-kawatra That's a great idea, but it will require ML no? Until obviously, we use the exact name for searching and loop through all the events present. Have you given the implementation any thought? Although, you don't absolutely have to, its a great idea!

yitik-kawatra commented 4 years ago

We will not require ML, It can be done by javascript and we can filter the events each time the person type a letter means on every letter pressed we can filter the events with the corresponding search.

lisa761 commented 4 years ago

Sorry, that was a typo :( Yeah, that could be done, what do you think about its time complexity?

Its a great idea altogether, but I am afraid, implementation through javascript will really restrict it(?). Searching is something that many people adopt ML to do for greater efficiency and accuracy.

Can you elaborate some more on your implementation? Do you mean, for eg. If I type i first, then it will show me all the events that have i in the beginning, or all the events that have i anywhere? And if you mean the latter, then what about when I type ie, would it show me all the events that have i and e or will it compare based on the sequence of those letters, that is, tell me all the events that have ie in that exact order? Here also, I guess the latter would be a better option. So overall, you will read the input of the search and apply it on the previous results to loop through them again and find the matching events based on the sequence of the letters, if I am right? At what point, will you terminate this search? And listening for every key press might bring in some trouble if someone is typing an entire word without a pause (I am not too sure), do you think that would create a problem? Have you implemented this before? Its a great idea and I am not opposed to the implementation you are suggesting, per se.

soumyaa1804 commented 4 years ago

@yitik-kawatra, the idea to implement search is great but I don't think we'll be able to implement it rn as the events name are all hardcoded and we don't actually parse it from a JSON file or any other data file to render it on the main page. The search feature would be doable if we create a JSON file that will have details of all the events and then loop through it to find the correct match.

Doing it this way would also be a helpful step in taking the project toward Do Not Repeat Yourself principle by implementing this piece of code through a javascript function that loops through the data file and rendering the event card for every event instead of repeating that piece of code for every event.

lisa761 commented 4 years ago

Like @soumyaa1804 explained, actually getting into it would entail a lot of changes in the current implementation. As for moving it towards a non-repetitive goal, it would be an enhancement that should be implemented regardless of this, and separately from this.

I don't think it would be fair to have someone spend a lot of time making the relevant changes to implement this, when its not for the real website. It would be an amazing feature, and I am sure we could incorporate it at a later time. And if @yitik-kawatra would like to, we can hit him up when we do do it.

But if you still would like to go ahead with this without changing a lot of the implementation, I think, it could be manageable if we just create an array or an object with hard-coded values in javascript.

yitik-kawatra commented 4 years ago

Yes i have tried to implement it through javascript but I also think that it will take lot more of time and i won't be able to give that much of time so will try another features which can be implemented in given time.

lisa761 commented 4 years ago

That's alright too.

tichnas commented 4 years ago

I'm not sure if I should ask this here, please ignore if I shouldn't. I know how to filter search results by using JS but can anyone tell me how will we update the webpage after searching without reloading? (Not in this particular case, but in general)

soumyaa1804 commented 4 years ago

@tichnas, that's totally alright to ask it here. Here is a YouTube tutorial you can go through.

tichnas commented 4 years ago

@tichnas, that's totally alright to ask it here. Here is a YouTube tutorial you can go through.

Thanks for a quick reply.