Google custom search API - sorting / filter

前端 未结 1 1397
我寻月下人不归
我寻月下人不归 2021-01-22 06:32

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条回答
  • 2021-01-22 06:38

    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.

    0 讨论(0)
提交回复
热议问题