18 ms·
> So it neeeded to scan through the cached contents of all of them to find which ones had the phrase in order. If you have a positional index [1] you don't ha
by yorwba 7y ago
> So it neeeded to scan through the cached contents of all of them to find which ones had the phrase in order.
If you have a positional index [1] you don't have to go through the full cached content, you only have to check the index to see whether there's an occurrence of the words in the query with the correct distance. E.g. for that Reddit post, you'd check the 17 occurrences of "from" and notice quickly that your query string doesn't match at that position.
[1] https://nlp.stanford.edu/IR-book/html/htmledition/positional-indexes-1.html https://nlp.stanford.edu/IR-book/html/htmledition/positional...