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
Improve the "purge search results cache" label #1048
Conversation
*/ | ||
public function purgeSearchTables() | ||
public function purgeSearchIndex() |
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.
Isn't the new method deprecated as well, because people should use the contao.search.indexer
service?
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.
We're only using this method to also purge the search cache folder. I could move that logic to the DefaultIndexer
though. Wdyt?
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.
If we do not need the new method then, I am for it. 👍
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.
Agree 👍
'index' => array | ||
( | ||
'callback' => array('Contao\Automator', 'purgeSearchTables'), | ||
'affected' => array('tl_search', 'tl_search_index') |
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.
I understand why you have removed this, but being able to see the number of entires in the tl_search tables was pretty helpful. Are you planning on re-adding it in some way in your crawler implementation?
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.
We would need to implement some getNumberOfEntries()
on the IndexerInterface
. Not sure if that makes sense?
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.
I am not sure if it makes sense on the interface, either.
I only know that being able to see the number of entries in the tl_search tables helped me see whether rebuilding the search index was successful and it helped me spot problems that caused the search index to grow too much. Therefore I would like to keep this information visible somehow.
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.
Okay, I see. Good point. We do need to extend the interface then. Otherwise, if I disable the default search indexer and implement some Algolia search, this information is not helpful here, right?
I don't think you need to know the entries of tl_search and tl_search_index. A normal user doesn't know what these two tables are for anyway, right? I guess you only need them to see if there are any entries or not, correct?
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.
Yes.
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.
Okay, let me come up with a proposal then :)
After working a bit on this I noticed that it does not make much sense to implement this globally. If I'm implementing a different indexer with e.g. Algolia I might want to show additonal information except for only the number of entries. I think we can agree that the two maintenance tasks are for the built in search and they don't have to be abstracted. I can easily unset them if I don't want them to be present. I've improved the label though :) |
1229f5b
to
19bfb7b
Compare
Thank you @Toflar. |
Fixed incorrect maintenance information now that we have a search indexer abstraction.