Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1] Returns correct search results when post moderation is enabled #8458

Merged

Conversation

Sesquipedalian
Copy link
Member

@Sesquipedalian Sesquipedalian commented Feb 11, 2025

Fixes #7870 for SMF 2.1.

Closes #8332

@Sesquipedalian Sesquipedalian added this to the 2.1.5 milestone Feb 11, 2025
@Sesquipedalian
Copy link
Member Author

@sbulen

@sbulen
Copy link
Contributor

sbulen commented Feb 12, 2025

Assuming everyone's on board with the db change!

The behavior matches current behavior. Whether that's good or bad is up to you!

When searching within a topic, or when showing results as messages, you will see all messages that have the term. However, under all other circumstances, you will only see one message per topic that includes the term.

Some folks like the current behavior - though I'm not sure how much of that is "that's how it's always been".

We do get occasional complaints on the support board, though, that search results are incomplete. So not everybody likes the current behavior.

I had thought that changing this index would change this behavior, but it didn't... This PR matches current behavior; the one-result-per-topic is enforced elsewhere.

To demonstrate... In this test env, there are 3 topics, across two boards:

  • Topic: "Searched Topic" is within the board "Searched Board"
  • Topic: "Not Searched Topic" is within the board "Searched Board"
  • Topic: "Not Searched Board" is within the board "Not Searched Board"

Each topic has 3 posts, "Lions", "Lions and Tigers", and "Lions and Tigers and Bears".

So there are 3 x 3 = 9 total posts include the term "Lions" across the 3 topics:
These are only visible if you check the box "Show results as messages" on the search form.

across-topics-as-msgs

Searching across topics only gives you 3 results, one per topic (to the consternation of some):
If you do not check the box "Show results as messages" on the search form.

across-topics

Searching within a topic gives you all 3 within that topic:

within-topics

@sbulen
Copy link
Contributor

sbulen commented Feb 12, 2025

Part of the challenge with the above is that "Show results as messages" really means something else... It means "show all messages, not just one per topic, and show the entire message, don't truncate it"...

I wonder if "Show complete results" addresses the confusion (in English anyway)...

@Sesquipedalian
Copy link
Member Author

Assuming everyone's on board with the db change!

It's just dropping and re-adding a primary key index. Nothing substantial.

The behavior matches current behavior. Whether that's good or bad is up to you!

There's no plan to change the intended behaviour, at least not in 2.1. The goal is just to fix the bug.

In 3.0 we could talk about changing how search results are filtered. I agree that it would be better to always show all matching messages and relabel the "Show results as messages" search option as "Show full message text" or something like that. Perhaps we could even pretty it up a bit by grouping messages from the same topic together.

@Sesquipedalian Sesquipedalian merged commit 1cc691b into SimpleMachines:release-2.1 Feb 16, 2025
8 checks passed
@Sesquipedalian Sesquipedalian deleted the 2.1/search_topic branch February 16, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants