The forum search looks for full words, not strings

The forum search seems to only find strings that are “complete words”, not just a general matching string. For example I would expect a search for “trigger” to find strictly more results than searching for “triggered”, but that’s not the case.

I get the same number of results for both queries. What are you seeing?

That was just an example- most threads that include one of those words also include the other one, so both searches return around the same number of results. If you want a more easily visible example, search for “trigge”.

Well, “trigger” is much more common in the database than “triggered”. The forum search engine treats a search for either one as a search for both. I get https://apps.magicjudges.org/forum/topic/46779/?page=1#post-271367 as a result for “triggered”, even though that word does not appear in that thread.

“trigge” isn’t a word and only appears in the database 3 times, so the forum search engine probably doesn’t even treat it as a real term. Searching for one term can return results for similar terms, but probably those terms have to already be in the index.

Ok, I guess it’s more complex than I assumed. There are still a number of cases where it doesn’t behave as ideally though. To use an earlier example, if I search for “Martin” in the author field it will find posts by Martin Hergeth because his username is “martin@hergeth.name”, but if I search for “Isaac” it will not find my posts, despite the fact that “Isaac” is a substring of my username. (“IsaacKing”.)

Okay, so author names are different than search queries. Search queries are an ElasticSearch5 Query String full text query. They use search terms with fuzziness AUTO, default_operator OR, and auto_generate_phrase_queries set to True. Author names are supposed to be a string equality check on the author__username field, however, I’m not sure how that data gets into the index, and it’s possible that the @ symbol in the username is being truncated in the index.