You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
finalGHContentSearchBuildersearcher;
searcher.repo("foo").q("query1").list(); // terms are repo:foo, query1searcher.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?
The text was updated successfully, but these errors were encountered:
You'd expect search.q("foo").q("bar").list() to search "foo" and "bar", so I'm not sure if the overwriting is expected. Perhaps your point is more about making list() reset the terms?
Between the backward compatibility & obvious "work around", I'm not going to change this.
Yea, backwards compatibility and work arounds probably make this not worth
changing. For calls like `repo()` it only makes sense to have one repo.
Maybe pointer in the docs would help.
On Sat, Nov 26, 2016 at 5:52 PM, Kohsuke Kawaguchi ***@***.*** > wrote:
You'd expect search.q("foo").q("bar").list() to search "foo" and "bar",
so I'm not sure if the overwriting is expected. Perhaps your point is more
about making list() reset the terms?
Between the backward compatibility & obvious "work around", I'm not going
to change this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#314 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdVbaLBKTi4GyC1FUVlipF3VHjA92fiks5rCLgUgaJpZM4K8tix>
.
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 extendsGHSearchBuilder
, it'srepo()
method would overwrite previous calls ofrepo()
. I was confused when my search results from the second call below was the same as the first.The reason is because calling
repo()
(and other methods likein()
, etc) add terms instead of overwriting previous ones. See above comments.Consider overwriting as that seems more intuitive?
The text was updated successfully, but these errors were encountered: