-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Purge the search tables directly #2265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. 👍🏻 Let's wait for @Toflar's approval though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me, however, it was @ausi who built that when implementing the new search :)
Shouldn’t we instead not query the
I think I mainly switched to the indexer to remove the duplicated SQL code in |
How would we find the URL that belongs to the page ID then? |
It doesn't work with other indexes. The (might) need to register their own callbacks. |
We could let the indexers themself decide what to delete? $this->searchIndexer->delete(new Document(
new Uri(''),
404,
[],
'<script type="application/ld+json">' . json_encode([
'@context' => 'https://contao.org/',
'@type' => 'Page',
'pageId' => (int) $pageId,
]) . '</script>'
)); |
That is a clever idea for sure. 🦊 |
I propsed the same idea to @aschempp yesterday but there's just so much more that could possibly be added there. I can add my own JSON-LD data in the FE and use that to index. It would be missing here again. |
The page ID is the only information we have in this case. If you added your own JSON-LD data, you can create a callback and call But this way we have the benefit, that the indexer can decide if and how it wants to handle the deletion. |
I tend to agree, yes. |
It might work. I'm just not sure the (massive) overhead is really worth the effort of theoretically have someone implement their own search index. @Toflar and me also discussed that search results should use the same tags the reverse proxy does. This would allow to correctly purge the search from everywhere (e.g. when changing a news item). |
Ok, so how do we proceed? Are we going with @ausi's suggestion above or do I merge this PR?
I assume that this would be a second step in a separate feature PR. |
🤷 I would opt for my (simple) solution and hope for tags support in a future release … |
I think we should merge this PR for now and create a new issue for the suggestion from #2265 (comment) |
core-bundle/src/EventListener/DataContainer/PageUrlListener.php
Outdated
Show resolved
Hide resolved
60a8a6d
to
97e747c
Compare
Description ----------- | Q | A | -----------------| --- | Fixed issues | Fixes contao#2162 It does not make sense to delete from the search indexer(s), because we query the `tl_search` table directly. This can only work with the default indexer anyway. Commits ------- 2f4bb81 Purge the search tables directly 97e747c CS 4033df8 Merge branch '4.10' into bugfix/search-indexer
It does not make sense to delete from the search indexer(s), because we query the
tl_search
table directly. This can only work with the default indexer anyway.