Skip to content

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

Open
jonstodle wants to merge 2 commits into
spectresystems:developfrom
jonstodle:feature/GH-8
Open

Offer to search Google when no search results are returned#62
jonstodle wants to merge 2 commits into
spectresystems:developfrom
jonstodle:feature/GH-8

Conversation

@jonstodle
Copy link
Copy Markdown

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.

Add CreateFallbackResult to IQueryProvider
Return a fallback result when no results are returned
Copy link
Copy Markdown

@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.


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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@jonstodle
Copy link
Copy Markdown
Author

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

Let's get some more opinions, though 👍

@patriksvensson
Copy link
Copy Markdown
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
Copy Markdown

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