Google custom search API - sorting / filter

匆匆过客 提交于 2019-12-02 02:25:41

问题


Is there anyway to filter the results by page title tag or certain meta tags... I read the documentation... but it's a mess :-( Is anybody have an idea??


回答1:


Yes, you can sort and filter on custom meta tags.

First, put the data you want to filter on into meta tags: <meta name="color" value="blue">

Next, test that Google can find the tags by testing your URL with the Rich Snippet Tool Under the 'Structured data for filtering search results', you should see more:pagemap:metatags-color:blue.

Finally, query your custom search engine with the structured data string above. Putting more:pagemap:metatags-color:blue in the search box works, or use it with your query parameter (usually q) in the URL.

For numeric meta tags, you can sort with sort=more:pagemap:metatags-sales_rank (or whatever your attribute is).

To search on page title it should work to use Google's standard intitle: operator.



来源:https://stackoverflow.com/questions/12338785/google-custom-search-api-sorting-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!