despo / issuehub.io

Find open source issues to work on! (domain update)
http://issuehub.pro
MIT License
260 stars 174 forks source link

Search could be OR based instead of AND based #240

Open CarltonBranch opened 4 years ago

CarltonBranch commented 4 years ago

Hi, Just started using issuehub.io. It works really great but the search is not intuitive. I would think that if I select 3 labels, I would get back issues that have any of those 3 labels and not issues that have *all 3 labels present. The problem obviously gets worse if you want to add all relevant tags to get a thorough result set, but instead you get no results because of the above reasons.

This means that a search for "Hacktoberfest" and "First Timers Only" only have results that have both when intuitively I would think that my search should return matches for either tag.

What do you think?

Hanzig commented 4 years ago

Hi! I think that's a very fair point and would personally suggest OR instead of AND as well.

CarltonBranch commented 4 years ago

If someone can point me in the direction of how to make the update, I'd be happy to fork the repo and submit a PR for it

vbrandl commented 4 years ago

I just stumbled across the same issue and felt the behavior to be unexpected.

@CarltonBranch: I guess this is where the magic happens: https://github.com/despo/issuehub.io/blob/7c80a95c0ef006ca74945f0d5abb84914f0ee02b/lib/kobol/requests/issues.rb#L30 I don't know any Ruby but I think you need a way to distinguish between label and regular search term because I would suggest using AND logic for custom terms and OR logic for labels so the final result would be

(label_1 ∨ label_2 ∨ ... ∨ label_n) ∧ (custom_1 ∧ custom_2 ∧ ... ∧ custom_n)
xavierfigueroav commented 4 years ago

Hi. I also agree that an OR-based search is the most intuitive approach, it is what I expected to happen when using the app. BUT I think that allowing the user to choose the operator (OR or AND) could be useful, too.

That could lead to other points to consider, though:

  1. If AND and OR operators are allowed, more complex conditionals should be allowed, too? For instance, (x AND y) OR z?.

  2. Search might become less intuitive.

What do you think?