Stopwords are never removed when they’re a prefix too.
That’s because, as long as your query ends with “by”, your user may be searching for, e.g. “bycycle” (although there’s a typo, that’s just for the example).
So, in your query without a trailing space, “by” is a prefix, and as such it is not removed.
With a trailing space, it is not a prefix anymore, “by” becomes a stopword, and thus normally it should be removed.
This is the normal behaviour of our search engine, and will usually get you relevant results.
I would not recommend it, but if you wish to disable prefix-matching, you can do so by setting
queryType to the value
As an unrelated side-note, you may want to use
removeStopWords=["en"] instead of
removeStopWords=true if you only need English stopwords, because setting it to true removes all the stopwords from all the languages, which can be extremely greedy and break your relevance.