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

Results are returned even when no results are found #29

Open
larsdean opened this issue Feb 9, 2016 · 5 comments
Open

Results are returned even when no results are found #29

larsdean opened this issue Feb 9, 2016 · 5 comments

Comments

@larsdean
Copy link

larsdean commented Feb 9, 2016

When making searches with no results google's suggested results are returned - should return zero results?

@gsouf
Copy link
Owner

gsouf commented Feb 9, 2016

Please, to make sure I fully understand your issue, can you give me further details like the url you want to parse the results for ?

@larsdean
Copy link
Author

larsdean commented Feb 9, 2016

Sorry for not being clear in my issue :-)

The issue is when Google is "helping" or "correcting" the searches. If i search for a string in quotes like ""this returns nothinggg" no results are found, but Google then "helps" and removes the quotes and gives me the result for this instead. In this case the result given by the script should be empty.

The same is the case when Google is auto correcting strings that Google think contains typos.

Is there a way to filter this? Or at least get the total number of results for the search?

@gsouf
Copy link
Owner

gsouf commented Feb 9, 2016

I understand your issue. The param nfpr=1 is what you are looking for. You cann add it this way:

$googleUrl->setParam('nfr', '1');

This param will force google to use your exact search term and ignoring auto correction.

@larsdean
Copy link
Author

larsdean commented Feb 9, 2016

Hi Soufiane

thank you for your prompt response - that solves some of the issues - good
tip!

The only thing I miss now is a way filtering out the cases where Google
does not find my exact search term with quotes around - then Google removes
the quotes and show the result without the quoted.

Result:

No results found for "this term is not not found found".
Results for this term is not not found found (without quotes) :…

Med venlig hilsen / Best Regards
Lars Dahl

2016-02-09 13:34 GMT+01:00 Soufiane Ghzal [email protected]:

I understand your issue. The param nfpr=1 is what you are looking for.
You cann add it this way:

$googleUrl->setParam('nfr', '1');

This param will force google to use your exact search term and ignoring
auto correction.


Reply to this email directly or view it on GitHub
#29 (comment).

@gsouf
Copy link
Owner

gsouf commented Feb 9, 2016

@larsdean Well, I could reproduce this issue, unfortunately I dont have a solution at this moment, digging into google to find how to get rid of that

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

No branches or pull requests

2 participants