The list of stop words in Elasticsearch is:

a, an, and, are, as, at, be, but, by, for, if, in, into, 
is, it, no, not, of, on, or, such, that, the, their, 
then, there, these, they, this, to, was, will, with

The list of JavaScript reserved keywords is:

abstract, arguments, await, boolean, break, byte, case, 
catch, char, class, const, continue, debugger, default, 
delete, do, double, else, enum, eval, export, extends, 
false, final, finally, float, for, function, goto, if, 
implements, import, in, instanceof, int, interface, let, 
long, native, new, null, package, private, protected, 
public, return, short, static, super, switch, synchronized, 
this, throw, throws, transient, true, try, typeof, var, 
void, volatile, while, with, yield

That means that the overlap is:

for, if, in, this, with

And the remainder of the English stop words is:

a, an, and, are, as, at, be, but, by, into, is, it, no, 
not, of, on, or, such, that, the, their, then, there, 
these, they, to, was, will

Why does this matter? It matters when you're writing a search engine on English text that is about JavaScript. Such as, MDN Web Docs. At the time of writing, you can search for this because there's a special case explicitly for that word. But you can't search for for which is unfortunate.

But there's more! I think we should consider certain prototype words to be considered "reserved" because they are important JavaScript words that should not be treated as stop words. For example...

Comments

davidglezz

not reserved words but:
- "as" is commonly used in typescript.
- "then": Promise.then()
- And now we have "at" in arrays: [1,2,3].at(1)

Peter Bengtsson

Thanks!
I don't work on that search engine any more but I hope the people who took over is considering this.

Your email will never ever be published.

Previous:
My contribution to 2021 Earth Day: optimizing some bad favicons on MDN Web Docs April 23, 2021 Web development, MDN
Next:
The correct way to index data into Elasticsearch with (Python) elasticsearch-dsl May 14, 2021 Python, MDN, Elasticsearch
Related by category:
How to SSG a Vite SPA April 26, 2025 JavaScript
Switching from Next.js to Vite + wouter July 28, 2023 JavaScript
An ideal pattern to combine React Router with TanStack Query November 18, 2024 JavaScript
get in JavaScript is the same as property in Python February 13, 2025 JavaScript
Related by keyword:
How to get all of MDN Web Docs running locally June 9, 2021 Web development, MDN
ElasticSearch, snowball analyzer and stop words September 25, 2015 Python