/programmable-search/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
Custom Search engine returns no results programmatically but however displays results in console 1 Recommended Answer 8 Replies 0 Upvotes
1 Recommended Answer
$0 Recommended Answers
1 Relevant Answer
$0 Relevant Answers
I have an application that uses a custom Google search engine to do programmatic searches over a public website. Lately, the search does not seem to be working always as expected. In particular, it may return no results (programmatically) for queries which *do* display results in the (custom search) console. Why is this happening? Is this a bug? Something I have just noticed is that the programmatic API call returns an 'htmlCorrectedQuery' property which has a corrected spelling for the query. However, the corrected spelling appears NOT to be used in the search, and this looks like it may be explaining the 0 results returned vs. the 10000 or so returned for the corrected spelling for this particular query. Shouldn't the programmable search engine also search the 'htmlCorrectedQuery'? (and if not, why include it in the response???). It is disappointing to see the programmable search results being of lower quality than expected. Please advise. Thanks!
Details
Community content may not be verified or up-to-date. Learn more.
Recommended Answer Recommended Answers (1)
Recommended Answer
Most Relevant Answer
Hi Patricia,
Like to update that the thing which you have reported is expected behaviour when using JSON API.
For the JSON API, we only suggest a correct spelling, but do not automatically replace the original query so no results is served for the wrong spelled term.
You may choose to send another request with the corrected query/term to get results served when using JSON API.
Thanks
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Most Relevant Answer Most Relevant Answers (0)
All Replies (8)
Recommended Answer
Most Relevant Answer
Hi Patricia,
Can you please help me understand your query with more details. Please provide:
1. How have you implemented your Programmable Search Engine?
2. How are you performing query. Please provide me with few example of your query.
Thanks
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Hi Deepak, thanks for your reply. My query is done using the node sdk as follows:
customsearch.cse.list({
q: query,
cx: cx,
auth: key,
start: pagesRetrieved*10 + 1
}, (err, response) => {
if (err) {
console.log("Received error from GSC: ", err)
.....
}
}
})
This code is relatively old (it's been in production since 2018 and I noticed that the results obtained have degraded since then). This is being run with query being usually a set of words (there are some filters in place to remove certain other -stop words- from a user-generated phrase). For example: 'achive messages inbox' was the query I followed closely before I posted on Friday. This query, run in the CSE console returns results as expected (using 'archive' instead of 'achive' as a search term). However, within the node program, no results are being returned at all. When I inspected the response returned by the search service, I found the 'spelling' object in the response, with expected values in 'correctedQuery' and 'htmlCorrectedQuery').
Let me know if you need more details. Thanks!
This code is relatively old (it's been in production since 2018 and I noticed that the results obtained have degraded since then). This is being run with query being usually a set of words (there are some filters in place to remove certain other -stop words- from a user-generated phrase). For example: 'achive messages inbox' was the query I followed closely before I posted on Friday. This query, run in the CSE console returns results as expected (using 'archive' instead of 'achive' as a search term). However, within the node program, no results are being returned at all. When I inspected the response returned by the search service, I found the 'spelling' object in the response, with expected values in 'correctedQuery' and 'htmlCorrectedQuery').
Let me know if you need more details. Thanks!
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Hi Patricia,
Currently, there are 2 ways you can retrieve results using Programmable Search Engine.
i) Using the Search Element code. You will need to implement the default element code provided on the search engine control panel on your website. You can test results using the "Public URL" link:
ii) Using CS JSON API. You can enable the API Key from the API console and retrieve results using the Programmable Search Engine ID. The example JSON API query would be like:
https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=Your_Search_Engine_ID&q=<YOUR QUERY>
Which ever way you retrieve results, there will be spelling correction. When using Search Element code you will see:
Showing results for ......
Search instead for ....
When using CS JSON API, you will see:
},
"spelling": {
"correctedQuery": "......",
If you can provide me with your Programmable Search Engine ID, I'll retrieve results using both the implementation and check if no results are served.
Thanks
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Hi Deepak,
As my earlier response indicates, I am already using the JSON API via node (note: his is used within a bot, so no public search site GUI is being utilized). Id is 013827152706114721592:f3izex1yz8c . Thanks in advance for looking into it (hopefully you should be able to reproduce my results for that particular search query).
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Hi Patricia,
Performed search with the term "achive messages inbox" (without quotes) using your "Public URL" link and did got results served.
Then performed an JSON API query and was able to reproduce the problem, did not get results served even after spelling correction.
Have reported this to the concern team and will get back once I hear back from them.
Thanks
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Thanks so much for reporting this to the team Deepak! I'm glad you were able to reproduce my results. Looking forward to hearing more about this as the team has a chance to respond. Best regards,
-Patricia
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Hi Patricia,
Like to update that the thing which you have reported is expected behaviour when using JSON API.
For the JSON API, we only suggest a correct spelling, but do not automatically replace the original query so no results is served for the wrong spelled term.
You may choose to send another request with the corrected query/term to get results served when using JSON API.
Thanks
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
Recommended Answer
Most Relevant Answer
Sorry for not replying earlier Deepak (I wasn't notified that there was a reply so did not see it). I think that is unfortunate that the spelling correction is not happening automatically, but at least it looks like I may be able to submit another query, as you suggested, so there is a work-around for the problem. Thanks for looking into this!
Original Poster
marked this as an answer Recommended based on info available
Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.
Most relevant based on info available
Our automated system analyzes the replies to choose the one that's most likely to answer the question.
Helpful?
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
false
false
Notifications are currently off and you won't receive updates. To turn them on, go to Notifications preferences on your Profile page.
Please follow our content policy when creating your post.
Discard post?
You will lose what you have written so far.
Personal information found
We found the following personal information in your message:
This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?
A problem occurred. Please try again.
Create Reply
Edit Reply
Link to post
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.
Go to the Legal Help page to request content changes for legal reasons.
Reported post for abuse
Unable to send report.
Report post
What type of post are you reporting?
Post is disrespectful, about third party products or contains unrelated content or personal information.
Post contains harassment, hate speech, impersonation, nudity; malicious, illegal, sexually explicit or commercial content.
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.
Go to the Legal Help page to request content changes for legal reasons.
Reported post for abuse
Unable to send report.
Google user
This reply is no longer available.
Badges
Some community members might have badges that indicate their identity or level of participation in a community.
Google Employee — Google product team members and community managers
Community Specialist — Google partners who help ensure the quality of community content
Diamond Product Expert — Community members with product mastery who help other Google users and Product Experts
Platinum Product Expert — Community members with advanced product knowledge who help other Google users and Product Experts
Gold Product Expert — Community members with in-depth product knowledge who help other Google users by answering questions
Silver Product Expert — Community members with intermediate product knowledge who help other Google users by answering questions
Product Expert Alumni — Former Product Experts who are no longer members of the program
Community content may not be verified or up-to-date.
/programmable-search/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
/programmable-search/profile/0?hl=en