link和domain的区别

在百度和谷歌的区别.
其实link和domain在不同的搜索引擎代表不同的含义的,他们并不是都一样的。有人以为在百度link网址是查询网站的反向链接,其实这样认识是不正确的,link在百
度查询的并不是反向链接。link加上你的网址查询的不过想普通关键词一样来查询的,这只是搜索结果里包含你的域名。
而在google上,link查询的确实是一个网站的反向链接,但是这种反向链接是不正确,也是不全面的,因为google只是展示了你网站很小部分的反向链接,还有很多其
他的反向链接没有被显示出来。如果要查询你网站的反向链接,那么谷歌管理员工具可以帮到你。
下面说说domain,在百度里,domain可以用来查网页内容中包含某关键词。如:domain:web.6543.com 搜索结果是包含关键字词组(web.6543.com )的所有网页。这也
不能很完整的查询网站的反向链接,当然也不包含锚文本部分,同理,如果想查询有多少个网页包含了某个关键词,可以用domain查询,例如,domain:服装。
而在谷歌里,domain并不代表一个指令。只是一个普通的关键字。
function findPaths(list, targetId) { const { node, links } = list; const targetNode = node.find(n => n.id === targetId); // 查找目标节点 if (!targetNode) return { sameDomain: [], differentDomain: [] }; const targetDomain = targetNode.domain; // 获取目标节点的 domain const result = { sameDomain: [], differentDomain: [] }; // 遍历 links links.forEach(link => { if (link.from === targetId || link.to === targetId) { const fromNode = node.find(n => n.id === link.from); const toNode = node.find(n => n.id === link.to); if (fromNode && toNode) { const isSameDomain = (fromNode.domain === targetDomain && toNode.domain === targetDomain) || (link.fromdomain === targetDomain && link.todomain === targetDomain); if (isSameDomain) { result.sameDomain.push({ from: link.from, to: link.to, fromdomain: link.fromdomain, todomain: link.todomain }); } else { result.differentDomain.push({ from: link.from, to: link.to, fromdomain: link.fromdomain, todomain: link.todomain }); } } } }); return result; } // 示例数据 const list = { node: [ { id: '111', domain: 'x' }, { id: '222', domain: 'y' }, { id: '333', domain: 'y' }, { id: '444', domain: 'z' } ], links: [ { from: '222', to: '333', fromdomain: 'y', todomain: 'y' }, { from: '222', to: '111', fromdomain: 'y', todomain: 'x' }, { from: '444', to: '222', fromdomain: 'z', todomain: 'y' }, { from: '333', to: '444', fromdomain: 'y', todomain: 'z' }, ] };写错了,返回值不该是[ { "from": "222", "to": "111", "fromdomain": "y", "todomain": "x" }, { "from": "444", "to": "222", "fromdomain": "z", "todomain": "y" } ],缺了from333to444的路径
最新发布
05-30
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值