使用Google自定义搜索使用全名作为一个单词

发布于 2025-02-11 18:03:29 字数 414 浏览 3 评论 0原文

我有14个关键字的列表以及名称。我需要通过构建以下查询来通过自定义搜索JSON API发送请求:

"name * keyword1" OR "name * keyword2" OR "name * keyword3" OR ...

如果名称仅由一个单词组成,则该请求不超过32个单词的限制(在API中设置),但如果包含多个单词(例如,约翰·史密特(John Smit)),然后超出了限制,结果变得不正确。有什么方法可以强迫搜索接受名称为单个单词?

还是值得以某种方式构建不同的查询?例如,这样的事情:

"name" AND "keyword1" OR "keyword2" OR "keyword3" OR ...

然后剩下32-14 = 18个单词,这应该足以使其名称。

I have a list of 14 keywords, as well as the name. I need to send a request through the Custom Search JSON API by building the following query:

"name * keyword1" OR "name * keyword2" OR "name * keyword3" OR ...

If the name consists of only one word, then the request does not exceed the limit of 32 words (which is set in the api), but if it contains more than one word (for example, John Smit), then the limit is exceeded and the result becomes incorrect. Is there any way to force the search to accept the name as a single word?

Or maybe it's worth somehow building a different query? For example something like this:

"name" AND "keyword1" OR "keyword2" OR "keyword3" OR ...

Then there will be 32 - 14 = 18 words left, which should be enough for the name.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尐籹人 2025-02-18 18:03:29

是的,事实证明,可以通过更改查询来解决一切。最终请求看起来像这样:

"name" AND ("keyword1" OR "keyword2" OR "keyword3" OR ...)

Yes, it turned out that everything can be solved by changing the query. The final request looks something like this:

"name" AND ("keyword1" OR "keyword2" OR "keyword3" OR ...)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文