Skip to content

GHSearchBuilder terms are cumulative when I expected them to overwrite previous one #314

@davidxia

Description

@davidxia

This isn't a huge deal, but I thought I'd point out something I didn't expect as a user.

I thought that if I reused GHContentSearchBuilder which extends GHSearchBuilder, it's repo() method would overwrite previous calls of repo(). I was confused when my search results from the second call below was the same as the first.

final GHContentSearchBuilder searcher;
searcher.repo("foo").q("query1").list(); // terms are repo:foo, query1
searcher.repo("bar").q("query2").list(); // terms are repo:foo, query1, repo:bar, query2

The reason is because calling repo() (and other methods like in(), etc) add terms instead of overwriting previous ones. See above comments.

Consider overwriting as that seems more intuitive?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions