Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google use another scheme for SearchAction #3334

Open
WinterSilence opened this issue Jun 6, 2023 · 6 comments
Open

Google use another scheme for SearchAction #3334

WinterSilence opened this issue Jun 6, 2023 · 6 comments
Labels
no-issue-activity Discuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!).

Comments

@WinterSilence
Copy link

https://search.google.com/test/rich-results mark code as invalid:

<div itemscope itemtype="https://schema.org/WebSite">
    <link itemprop="url" href="http://www.example.com/"/>
    <form itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
          <meta itemprop="target" content="http://example.com/search?q={query}"/>
      <input itemprop="query" type="text" name="query"/>
      <input type="submit"/>
    </form>
</div>

Example from https://schema.org/SearchAction

Google use modified scheme as SearchAction -https://developers.google.com/search/docs/appearance/structured-data/sitelinks-searchbox

Google ignored any my messages, can you told Google about BC problems?

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

This issue is being nudged due to inactivity.

@github-actions github-actions bot added the no-issue-activity Discuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!). label Sep 5, 2023
@WeaverStever
Copy link

Changed "query" to "query-input" seems to work on Rich Result Test
https://search.google.com/test/rich-results/result?id=nrY5cuzCukUwiuIfjpGgNA

<div itemscope itemtype="https://schema.org/WebSite">
    <link itemprop="url" href="http://www.example.com/"/>
    <form itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
          <meta itemprop="target" content="http://example.com/search?q={query}"/>
      <input itemprop="query-input" type="text" name="query"/>
      <input type="submit"/>
    </form>
</div>

@KalleOlaviNiemitalo
Copy link

The -input suffix in query-input is documented at Potential Actions Part 4: Input and Output constraints

@KalleOlaviNiemitalo
Copy link

but… I don't believe input itemprop="query-input" is correct, as the value of query-input should be an instance of https://schema.org/PropertyValueSpecification, or a string representation of that, i.e. a specification of what kind of value the action expects as input and how it should be passed in, rather than the query value itself.

@github-actions github-actions bot removed the no-issue-activity Discuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!). label Sep 10, 2023
@WeaverStever
Copy link

@KalleOlaviNiemitalo

Looking at the JSON-LD example on Google, I see what you mean, the target needs an Entrypoint wrapper

JSON-LD (GOOGLE)

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "url": "https://www.example.com/",
      "potentialAction": {
        "@type": "SearchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://query.example.com/search?q={search_term_string}"
        },
        "query-input": "required name=search_term_string"
      }
    }
    </script>
  </head>

Microdata

<div itemscope itemtype="https://schema.org/WebSite">
   <link itemprop="url" href="http://www.example.com/"/>
   <form itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
      <div itemprop="target" itemscope itemtype="https://schema.org/EntryPoint">
         <meta itemprop="urlTemplate" content="http://example.com/search?q={query}"/>
      </div>
      <input itemprop="query-input" type="text" name="query"/>
      <input type="submit"/>
   </form>
</div>

Copy link

This issue is being nudged due to inactivity.

@github-actions github-actions bot added the no-issue-activity Discuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!). label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity Discuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!).
Projects
None yet
Development

No branches or pull requests

3 participants