Skip to content

Conversation

@seren5240
Copy link
Contributor

fixes #16040

The issue seems to be because of MongoDB's underlying text search whose tokenisation doesn't prioritise the year enough to filter out tournaments titled with a different year. Being totally new to Scala and Mongo, I don't know if this is the right solution and what performance implications it may have, but it's a suggestion if the ability for users to easily filter on a year appearing in the tournament name is sufficiently important. Tested with a broadcast titled "British Championships 2024" where "championship 2021" would match under production code, and not match after the proposed change.

@ornicar
Copy link
Collaborator

ornicar commented Sep 12, 2024

It's a bit of a weird solution but I can't find any better one. Thanks.

@ornicar ornicar merged commit 2dfa307 into lichess-org:master Sep 12, 2024
@kraktus
Copy link
Member

kraktus commented Sep 13, 2024

Wouldn't a cleaner solution be to prioritise more the text score? Or set a minimum textScore before considering the date

        "searchDate" -> $doc(
          "$add" -> $arr(
            $doc("$ifNull"   -> $arr("$syncedAt", "$createdAt")),
            $doc("$multiply" -> $arr($doc("$add" -> $arr("$tier", -RelayTour.Tier.NORMAL)), 60 * day)),
            $doc("$multiply" -> $arr($doc("$meta" -> "textScore"), 30 * day))
          )
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

broadcast search: dates seem to be ignored

3 participants