我有三种类型的内容(type1,type2,type3)
我对每个内容的当前搜索格式链接如下:
http://example.com/search?q=search&type=type1
http://example.com/search?q=search&type=type2
http://example.com/search?q=search&type=type3或者我可以把它改成这个:
http://example.com/search?type1=search
http://example.com/search?type2=search
http://example.com/search?type3=search这个JSON-LD代码是真的吗?
"potentialAction":
[
{
"@type": "SearchAction",
"target": "http://example/search?type1={search_term_string}",
"query-input": "required name=search type 1"
},
{
"@type": "SearchAction",
"target": "http://example/search?type2={search_term_string}",
"query-input": "required name=search type 2"
},
{
"@type": "SearchAction",
"target": "http://example/search?type3={search_term_string}",
"query-input": "required name=search type 3"
}
] 发布于 2017-06-09 11:01:14
query-input和target
query-input属性的值必须是在target值中指定的占位符的名称(作为required name=的后缀)。
对于target值http://example/search?type1={search_term_string},占位符为(由{和}指示):search_term_string。
因此,您必须使用required name=search type 1而不是required name=search_term_string。
多重SearchAction
从Schema.org的角度来看,提供多个SearchAction类型的potentialAction值是很好的。
但是对于谷歌的Sitelinks Searchbox,请注意他们的文件上说
总是为网站指定一个
SearchAction,如果支持应用程序搜索,则可以选择另一个。
富结果只具有一个搜索框,但您指定了三个SearchAction项。在这种情况下会发生什么是没有记录的(例如,Google可以决定总是使用第一个,或者根本不使用)。
https://stackoverflow.com/questions/44455171
复制相似问题