lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Advanced Search and Tag Filtering

Open 8ullyMaguire opened this issue 1 year ago • 4 comments

Requirements

  • [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a feature request? Do not put multiple feature requests in one issue.
  • [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

Yes, the current tagging system in Lemmy lacks advanced filtering options, making it difficult for users to find and organize content based on specific tag combinations. This feature request aims to address this limitation by proposing the implementation of advanced tag filters, similar to those found in image organizing programs^1 and booru-style image boards^2.

Describe the solution you'd like.

I propose the addition of advanced tag filtering options in Lemmy, allowing users to:

  1. Hide posts with chosen tags.
  2. Show posts where all chosen tags exist.
  3. Show posts with at least one of the chosen tags.
  4. Show posts with at least one of the chosen tags but exclude ones that have chosen unwanted tags.

Additionally, it would be helpful to allow users to save presets and give them names for easy access to their preferred filtering options.

image image image image

This feature request is inspired by the advanced filtering options found in the UI of an image organizing program mentioned by @M4rtineski in the original comment^1 and the booru-style image view, search, and tagging system discussed in issue #3626.

Describe alternatives you've considered.

An alternative solution could be to integrate third-party tools or libraries that offer advanced tag filtering options. However, implementing a native solution within Lemmy would provide a more seamless user experience and better integration with the platform's existing features.

Additional context

Advanced tag filtering options have proven to be successful in other platforms, such as booru-style image boards^2 and image organizing programs^1. Implementing these features in Lemmy would enhance the user experience by allowing users to find and organize content more efficiently based on their preferences.

Related

8ullyMaguire avatar Aug 01 '23 11:08 8ullyMaguire

Also for the frontend, I would like to be able to choose to search either from buttons like shown in the images above or with syntax similar to this, but I don't know if this would require doing anything different in the backend so I mention it here.

  • Quotes: "some terms that must be together"
  • Negative terms: cat -dog (shows posts about cats that don't mention dogs)
  • Either or: cat OR dog (shows posts about either cats or dogs). The default search behavior is an implicit AND, but order doesn't matter.
  • !safeoff – Disables safe search allowing NSFW posts to appear in the search results (NSFW is now hidden by default)
  • since:YYYY-MM-DD – shows only posts that have occurred since the specified date
  • until:YYYY-MM-DD – same as above but in reverse. It will only posts up to the given date

References:

8ullyMaguire avatar Aug 01 '23 14:08 8ullyMaguire

[Feature request] Search operator support in Lemmy search

It goes like this:

  • "Hello World" - only shows results (posts, comments) with the title "Hello World" but not results with "hello" and "world"
  • case:on - enables case-sensitive search*
  • instance:<instance.com> - Show search results from a particular instance.
  • -instance:<instance.com> - Excludes instance from search results.
  • -keyword - search for results that don't mention a word or phrase. -"hello world" excludes the phrase "hello world" from search results. To exclude a phrase, the searcher will have to use apostrophes (e.g: -"hello johnny")
  • -community:<community>@<instance.com> - Excludes community from search results. If <instance.com> is not provided, it excludes the community from the current instance from the search results.
  • * Matching any word or phrase. Example: steve * apple
  • before:yyyy-mm-dd - Shows results before from a particular date;
  • after:yyyy-mm-dd - Shows results after from a particular date.
  • community:<community>@<instance.com> - If <instance.com> is not provided, it will only show results from the current instance. Otherwise, it will show search results from the community of that particular instance where it is hosted.
  • Backslashes "\" before a character (@, :,) to mean literal @ and :

8ullyMaguire avatar Aug 01 '23 14:08 8ullyMaguire

I'd like to have Reddit's search operators on Lemmy too: https://www.reddit.com/wiki/search/.

YousufSSyed avatar Aug 25 '23 02:08 YousufSSyed

Request for change by @Neshura87 that was written based on #317

This is similar proposal but we would need to choose one for implementation.

ludrol avatar Aug 26 '23 09:08 ludrol