首页 \ 问答 \ 搜索引擎如何进行'AND'操作?(How do search engines conduct 'AND' operation?)

搜索引擎如何进行'AND'操作?(How do search engines conduct 'AND' operation?)

请考虑以下搜索结果:

好。 页面被索引,它只需要查找索引表中的计数和前几个项目,因此速度是可以理解的。

现在考虑使用AND操作进行以下搜索

这让我勾选;)搜索引擎如何能够如此快速地在巨型数据集上获得AND操作的结果? 我看到以下两种方式来执行任务,两者都很糟糕:

  1. 你进行'大卫'的搜索。 拿着巨大的临时表,在上面搜索“John”。 但是,临时表未被“John”索引,因此需要进行强力搜索。 无论你有什么硬件,这都不会在0.25秒内计算出来。
  2. 通过所有可能的单词组合索引,如'David John'。 然后我们面临关键数量的组合爆炸,甚至谷歌都没有处理它的存储容量。

你可以和你想要的一起搜索短语 ,你仍然可以在0.5秒内获得答案! 怎么样?


Consider the following search results:

OK. Pages are indexed, it only needs to look up the count and the first few items in the index table, so speed is understandable.

Now consider the following search with AND operation:

This makes me ticked ;) How on earth can search engines get the result of AND operations on gigantic datasets so fast? I see the following two ways to conduct the task and both are terrible:

  1. You conduct the search of 'David'. Take the gigantic temp table and conduct a search of 'John' on it. HOWEVER, the temp table is not indexed by 'John', so brute force search is needed. That just won't compute within 0.25 sec no matter what HW you have.
  2. Indexing by all possible word combinations like 'David John'. Then we face a combinatorial explosion on the number of keys and not even Google has the storage capacity to handle that.

And you can AND together as many search phrases as you want and you still get answers under a 0.5 sec! How?


原文:https://stackoverflow.com/questions/2340665
更新时间:2022-03-10 14:03

最满意答案

而不是async使用defer 。 使用defer标记脚本将不会运行,直到页面加载! 像这样的东西:

<script src="source/to/script" defer></script>

Instead of async use defer. With defer tag script won't run until page loads! Something like this :

<script src="source/to/script" defer></script>

相关问答

更多