torrust / torrust-index-gui

This repository serves as the frontend for the Torrust Index project.
https://torrust.com
Other
32 stars 16 forks source link

Torrent isolation by tags behavior (AND vs OR) #599

Open ty5e3a45 opened 3 months ago

ty5e3a45 commented 3 months ago

Hey, Currently, selecting multiple tags results in listing all the torrents that have tag1 OR tag2. This should probably be tag1 AND tag2, otherwise it's kind of pointless.

Example: Selecting tags internet-archive and bitcoin lists these two torrents: Revenge of Doctor X Alice in wonderland librivox Revenge of Doctor X is the only torrent with both internet-archive and bitcoin as tags, but Alice in wonderland librivox is still listed due to it having the internet-archive tag.

Thanks,

josecelano commented 3 months ago

Hi @ty5e3a45, Thank you for your feedback. I guess that was the intended behaviour. Generally, when you are selling or buying something, you want to be as specific as possible. However, when you are searching for content, you may want to get more results. It's a trade-off.

Maybe you see the tags as a way to be more specific, but in some cases, you may choose two tags because you don't know which one the uploader would use. For example, people could use synonyms for the same concept. In that case, you want to include any of them.

If we change it, we should make sure that the AND is a more common requirement than the OR. (We don't have metrics for that), or we have to make sure the alternative way to get the same result manually is easier.

Maybe we can improve the filters to allow more complex alternatives. That would be a new feature. But let's see the different options we have and how the user can get those results.

Different types of queries could be:

Given the tags: paper, bitcoin, decentralization, Bitcoin

Search without grouping expressions:

  1. Torrents about decentralization and bitcoin: decentralization AND bitcoin.
  2. Torrents about decentralization or bitcoin: decentralization OR bitcoin.
  3. Torrents about exclusively decentralization or bitcoin (but not both at the same time): decentralization XOR bitcoin.
  4. Torrents about anything except decentralization or bitcoin: decentralization NOR bitcoin.

The current filter only allows type 2. It seems to be pointless, but it could be useful to find bitcoin OR Bitcoin.

Search grouping expressions:

  1. Papers about decentralization and bitcoin: paper AND (decentralization AND bitcoin).
  2. Papers about decentralization or bitcoin: paper AND (decentralization OR bitcoin).
  3. Papers about exclusively decentralization or bitcoin (but not both at the same time): paper AND (decentralization XOR bitcoin).
  4. Papers about anything except decentralization or bitcoin: paper AND (decentralization NOR bitcoin).

There are different ways to implement this. I guess the most obvious one is to allow expressions to be included in the input search box, but that's a complex new feature to implement.

Given that we can only implement these two cases with the current interface:

  1. Torrents about decentralization and bitcoin: decentralization AND bitcoin.
  2. Torrents about decentralization or bitcoin: decentralization OR bitcoin.

Users must manually do the one that is not implemented.

With the current behaviour, implementing the "OR", users must do the "AND" manually. You have to do both searches and check if the torrents have both tags.

If we do the opposite and implement the "AND" when the users want both tags ("OR") they have to execute both searches and all the results will be valid.

It looks like the "AND" is harder to replicate manually, so it makes sense to change the default behaviour, but based on the difficulty of the action and not on how common one filter will be over the other one on this site.

cc @torrust/torrustaceans

josecelano commented 3 months ago

Hi @ty5e3a45, I've just realized the torrent can only have one category. If we change the tags to use AND, the behaviour for the category filter would be different (OR). The category filter can only work with OR. I think that could be confusing for the user. Maybe that's the reason the filter was built that way originally.

I don't see an easy solution now. Do you have any ideas to avoid confusion?

cc @torrust/torrustaceans

josecelano commented 3 months ago

@da2ce7 suggested adding a dropdown inside the filter popup (maybe under the input search box) with the options: none, all, any, one

image

cc @ty5e3a45

Defaulting to all.

ty5e3a45 commented 3 months ago

@da2ce7 suggested adding a dropdown inside the filter popup (maybe under the input search box) with the options: none, all, any, one Defaulting to all.

Seems like a good solution.

I'm wondering how or if this would also extend to the Category filter? In contrast with the Tags, there can only be one Category per torrent, yet similarly to tags, multiple categories can be selected. If not to change the filter method, what about adding a mention of how the Category filter logic works?

cc: @josecelano

josecelano commented 3 months ago

@da2ce7 suggested adding a dropdown inside the filter popup (maybe under the input search box) with the options: none, all, any, one Defaulting to all.

Seems like a good solution.

I'm wondering how or if this would also extend to the Category filter? In contrast with the Tags, there can only be one Category per torrent, yet similarly to tags, multiple categories can be selected. If not to change the filter method, what about adding a mention of how the Category filter logic works?

cc: @josecelano

I think all filters also make sense except the all.

The all option could be disabled in the component. The default value could be one.

We could even rename the one option to exact or this.

Another extra improvement (and good practice) could be to show the current filter somewhere (like in my previous comment) and an option to remove all filters.

ty5e3a45 commented 3 months ago

Makes sense, and renaming one would definitely help (whether or not accompanied by examples like the ones given above).

Another extra improvement (and good practice) could be to show the current filter somewhere (like in my previous comment) and an option to remove all filters.

Would this be in addition to the current Clear All option that appears when selecting 2 or more categories or tags?

josecelano commented 3 months ago

Makes sense, and renaming one would definitely help (whether or not accompanied by examples like the ones given above).

Another extra improvement (and good practice) could be to show the current filter somewhere (like in my previous comment) and an option to remove all filters.

Would this be in addition to the current Clear All option that appears when selecting 2 or more categories or tags?

Yes, It would be a button to reset the whole filter. Something like this:

image

It should change the URL back to: https://index.torrust-demo.com/torrents or the full URL with all the default options.