Google Wildcard Operator (*)

Google Wildcard Operator (*)

输什么也不输骨气 发布于 2021-11-27 字数 745 浏览 885 回复 3 原文

I am using the google ajax rest api and I'd like to get local results by prefix. For example: I type in "sta" and I get "starbucks".

I wonder if there is a documented or undocumented wildcard operator that that allows you to find results that start with a string.

I know that Google does have a wildcard operator but it works on a word-by-word
basis. Like this: starbucks * => starbucks coffee

Here is a list of Google Search Operators none of which offer the starts-with functionality: http://www.google.com/support/websearch/bin/answer.py?hl=en&answer=13...

Thank you.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

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

评论(3

年华零落成诗 2022-06-07 3 楼

You can, in the standard search box, string together multiple wildcards, e.g., star* * , where wrapping that in quotes may further get you the phrase you want, e.g., "star * location*".

Alternatively, you may find some success using the AROUND() search filter [all caps], e.g., star* AROUND() location. The AROUND() filter also accepts an inclusive numerical filter, e.g., "star* AROUND(3) location*", which would return any words that start with star and which are within three words or less of location, locations, etc.

To contrast, the * denotes a specific number of spaces, e.g., star* * * location, where star is exactly three terms away from location, but not one or two locations or away. star* AROUND(3) location would return results where star and location are three terms or less apart.

YMMV as to whether these advanced Google Search filters can be used as part an API query.

慈悲佛祖 2022-06-07 2 楼

Probably not the answer you want to hear, but I'm reasonably certain that what you're looking to do isn't supported.

送舟行 2022-06-07 1 楼

What you're looking for is a Google Suggest API for the local search. Given that there seems to be no official Google Suggest API, you aren't likely to find one for the local search. However, there are plenty of products (including Firefox and the Google Toolbar) that make use of Google Suggest, so the methods they use probably aren't going away. A quick search for a Suggest API turns up many solutions that have been put together by various people. I recommend you pick one that looks like a good fit and try to make it work with the local search (if that actually turns up different results).