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

Offer to search Google when no search results are returned #62

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jonstodle
Copy link

Adds a function on IQueryProvider to supply a "fallback result" which supplies a generic search with the provider. This makes it possible to add a setting specifying a desired fallback provider in the user settings later.

This closes #8.

Copy link

@reinismu reinismu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this kind of thing should be made differently. I propose that there should be property "IsGlobalProvider" and when search returns nothing or less than some amount then we could fill it in with global providers like google. Than any provider would have this option. Another thing is that not everyone will want this, so configuration must be in place for it.

@@ -48,6 +48,11 @@ public FileProvider(IFileIndex index, IconLoader loader)
return await _index.Find(query.Raw?.Trim(), CancellationToken.None).ConfigureAwait(false);
}

protected override Task<IQueryResult> CreateFallbackResult(string query)
{
throw new NotImplementedException();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this should be here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is a bit temporary (forgot to add a comment about that). Any suggestions on how to handle the cases where a provider is not global provider

@jonstodle
Copy link
Author

I see your point about not every provider being a global provider. Do you think the IsGlobalProvider should be on IQueryProvider or some other interface?

@reinismu
Copy link

Maybe not a property, but extended IQueryProvider -> IGlobalQueryProvider. Tho it depends. Need more people opinion on this.

@jonstodle
Copy link
Author

Yeah, that's more like what I was leaning towards too.

Let's get some more opinions, though 👍

@patriksvensson
Copy link
Member

Nice initiative, but I think this PR strays from the original issue which was that the Google provider should allow you to search for things not suggested by the Google web service.

Personally I think that each provider should be responsible for whether or not to show fallback values, and not done globally.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google search should always return exact search
4 participants