Skip to content

Can a search for "answers:n" limit itself to post types that can have answers? #797

@cellio

Description

@cellio

https://meta.codidact.com/posts/286454/286456#answer-286456

Searching for answers:0 returns results that are answers (because they don't have answers). That's not, strictly speaking, wrong, but it's a little confusing.

Can a search that includes the "answers" keyword restrict itself to searching post types that can have answers? Currently that's just questions, but we shouldn't bake in "is a question" because there could be other top-level post types in the future that have answers.

If the search already specifies a post type (like question) then we should use it; in a future where there's another kind of answerable post, we wouldn't want to expand the search. So I think the logic should be:

if search includes `answers:`
    then if search includes `post-type:`
        then do that
    else add "post types that can have answers" to search
else... (rest of search logic)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendChanges to server-side codecomplexity: unassessedNeeds further developer investigation before complexity/feasibility can be determined.priority: medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions