Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow search results to not fail when searching namespaced tags without namespaces. #395

Open
chaskayote opened this issue Jan 5, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@chaskayote
Copy link

Is your feature request related to a problem? Please describe.
Most people come to booru site and assume they can just type in the name of an oc or artist. For instance, search for dripponi and get results. As it is now, you have to type in artist:dripponi. (I do love namespaces and they're amazing but this was more for user friendly.

Describe the solution you'd like
Searching for artist:dripponi and dripponi both bring up the same search results.

Describe alternatives you've considered
Dealing with it. Potential issues is if an artist name matches a general tag with no namespace. It would be cool is if it could display both tags and then you could click one to drill down.

Additional context
I've tried experimenting with this with some edits to the code. I tried editing line 159 of search_index.ex to the following:

        name: image.tags |> Enum.flat_map(&([&1] ++ &1.aliases)) |> Enum.map(& &1.name),
        name_in_namespace:
          image.tags |> Enum.flat_map(&([&1] ++ &1.aliases)) |> Enum.map(& &1.name_in_namespace)

and changing line 96 of query.ex to
default_field: {"namespaced_tags.name_in_namespace", :term},

The problem I'm having is now searching the old way fails and when "dripponi" comes up, it doesn't show the tag details just the images.

@chaskayote chaskayote added the enhancement New feature or request label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant