?q=how+does+search+workWhat happens after you press Enter
Crawling, indexing and ranking explained without code, plus the small file that adds a website to your browser’s search box.
Three steps behind every result
- Crawl. Programs called crawlers fetch pages and follow their links. A site’s robots.txt file can ask them to skip some paths, but it is a request, not a lock.
- Index. Words are pulled out of each page and stored in an inverted index: for every word, a list of the pages that contain it.
- Rank. When you search, the engine finds pages with your words and puts them in order. Many open-source engines start from a formula called BM25, which rewards rare words that appear often in a page.
One name, two different things
2005 · a file formatOpenSearch description
A short XML file, first published by Amazon’s A9 search company. A site links to it, and browsers that support it can add that site to their list of search engines. The file holds a URL template with a {searchTerms} placeholder.
2021 · a search engineOpenSearch software
An open-source search and analytics suite that began as a fork of Elasticsearch and Kibana. Since 2024 it has been run by the OpenSearch Software Foundation under the Linux Foundation.

Operators worth knowing
| Type this | What it does |
|---|---|
"exact phrase" | Looks for the words together, in that order. |
jaguar -car | Leaves out pages that mention the word after the minus. |
site:example.org | Searches one website only. |
filetype:pdf | Asks for one kind of file, on engines that support it. |
Support differs from engine to engine, and some operators change over time.
From words to tokens
Before a search engine can match your query, it has to break both the query and every page into small units called tokens, usually words. That step sounds simple but hides many decisions. Should “e-mail” be one token or two? Should capital letters matter? Should “running”, “runs” and “ran” all count as the same idea? Most engines lower-case text, split it at spaces and punctuation, and then apply language-specific rules.
- Stemming
- Cutting words back to a common root, so a search for “connecting” also finds “connected” and “connection”.
- Stop words
- Very common words such as “the” and “of”, which some engines give little weight because they appear almost everywhere.
- Synonyms
- Lists that let a search for “sofa” also find pages that say “couch”.
- Languages without spaces
- Writing systems such as Chinese, Japanese and Thai do not always mark word boundaries, so engines use dictionaries or statistical models to find them.
Links as votes
In 1998 two Stanford graduate students, Larry Page and Sergey Brin, described a search engine that treated links between pages as signals of importance. Their idea, called PageRank, gave more weight to a page when many other pages linked to it, and even more when those linking pages were themselves important. It helped their engine, Google, return useful results at a time when competitors were easily fooled by pages that simply repeated popular words.
Today link analysis is only one of many signals. Modern engines also weigh how well a page answers the query, how recent it is, where the searcher is, how fast the page loads on a phone and whether the content looks trustworthy. The exact mix is secret and changes often.
Why two people see different results
Type the same words on two devices and the results may not match. Location is the biggest reason: a search for “pharmacy” or “weather” is answered for the place the engine thinks you are. Language settings matter too, as do the country version of the engine and, for signed-in users, past activity. Results also change over time as pages are added, updated or removed, and engines run constant experiments in which small groups of users see slightly different layouts.
If you need neutral results, for research or for checking how your own site appears, use a private window, sign out and set the region and language explicitly.
Choosing a search engine in Safari
- Open Safari’s settings on a Mac, or the Safari section of the Settings app on an iPhone or iPad.
- Find the search section and choose a default engine from the list. Options typically include Google, Bing, Yahoo, DuckDuckGo and Ecosia, depending on your region.
- Turn on Quick Website Search if you want Safari to remember the search boxes of sites you use, so you can type a site’s name followed by your query in the address bar.
- Turn search suggestions on or off depending on how much you want sent to the engine while you type.
The menu labels move slightly between versions of the operating system, but the search options have stayed in the same general area for years.
Helping search engines find a site
- Sitemaps. A sitemap is a file that lists a site’s pages. The format was introduced by Google in 2005 and soon adopted by other major engines through the shared sitemaps.org protocol.
- Clear titles. Each page should have a unique, descriptive title, because titles are often shown as the clickable headline in results.
- Descriptions. A short summary in the page’s meta description may appear under the title, although engines sometimes write their own.
- Internal links. Linking related pages together helps crawlers discover them and helps readers keep exploring.
- Speed and mobile. Pages that load quickly and read well on phones tend to serve searchers better.
Search on your own website
Large web search engines are not the only option. Many websites run their own internal search, and much of it rests on open-source software. Apache Lucene, a search library first written by Doug Cutting in 1999, sits underneath popular servers such as Apache Solr and Elasticsearch. These tools build an inverted index of a site’s content and rank matches with formulas similar to those used by big engines, while letting the owner adjust results for their own audience.
For small sites, a hosted search service or the built-in search of a publishing platform is often enough. The OpenSearch description file mentioned above then lets visitors add that search to their browser in a few clicks.
Privacy and your searches
Queries can reveal a great deal about a person: health worries, travel plans, money troubles. Engines differ in how much they store and for how long. Some keep a history linked to your account, which you can usually view and delete in its settings. Others promise not to build profiles at all. Private browsing modes stop your device from saving history locally, but they do not hide your activity from the search engine, your network provider or an employer’s network. Reading an engine’s privacy policy and checking its settings once is a small effort that pays off.
Autocomplete and “did you mean”
Suggestions that appear while you type are built from what many other people searched, combined with your language, location and sometimes your own history. They save typing but can also nudge people towards popular phrasings. Spelling correction works in a similar way: when a rare spelling is often followed by a search for a common one, the engine learns that the second was probably intended. That is why misspelled names of new products or people are sometimes corrected into something else until enough searches teach the system the new word.
Judging what you find
- Look at the source. Check who published the page and whether they are in a position to know.
- Check the date. Prices, laws and software instructions change; an old answer may no longer be right.
- Compare several results. Agreement between independent sources is more convincing than one confident page.
- Treat answer boxes with care. Summaries shown above the results are extracted or generated automatically and can drop important context.
- Notice advertising. Sponsored results are labelled, usually near the top, and are ranked partly by payment.
Searching inside a single page
Not every search needs the web. Once a long page is open, the browser’s own find feature is often the fastest tool. In Safari on a Mac, press Command and F, type a word and step through the highlighted matches. On an iPhone or iPad, tap the share or page menu and choose Find on Page, or type into the address bar and pick the “On This Page” suggestion. Find works on the text that is loaded, so on pages that add content as you scroll it may miss sections further down. For PDFs and long documents, the same shortcut usually searches the whole file, which is far quicker than scrolling.
Our notes
0 results Our first notes are still being indexed. The Search Glossary is a good place to start.
Partner posts
Advertisers can buy posts on this domain. Each one starts with a sponsored label, lives at its own address and is excluded from our lists and search results.
Frequently asked
Can I add any website to Safari’s search box?
Safari offers a fixed list of search engines. That gap is why add-ons such as the old OpenSearch for Safari extension appeared. Other browsers can add engines from an OpenSearch description file.
Does robots.txt keep a page secret?
No. It only asks well-behaved crawlers to stay away. Anything that must stay private needs a password or should not be online.
Is OpenSearch the same as Elasticsearch?
They share early code, because OpenSearch started as a fork in 2021, but the two projects have developed separately since then.
