return null;
}
+ /**
+ * Perform a title search in the article archive.
+ * NOTE: these results still should be filtered by
+ * matching against PageArchive, permissions checks etc
+ * The results returned by this methods are only sugegstions and
+ * may not end up being shown to the user.
+ *
+ * @param string $term Raw search term
+ * @return Status<Title[]>
+ * @since 1.29
+ */
+ function searchArchiveTitle( $term ) {
+ return Status::newGood( [] );
+ }
+
/**
* Perform a title-only search query and return a result set.
* If title searches are not supported or disabled, return null.
public function getSearchIndexFields() {
$models = ContentHandler::getContentModels();
$fields = [];
+ $seenHandlers = new SplObjectStorage();
foreach ( $models as $model ) {
- $handler = ContentHandler::getForModelID( $model );
+ try {
+ $handler = ContentHandler::getForModelID( $model );
+ }
+ catch ( MWUnknownContentModelException $e ) {
+ // If we can find no handler, ignore it
+ continue;
+ }
+ // Several models can have the same handler, so avoid processing it repeatedly
+ if ( $seenHandlers->contains( $handler ) ) {
+ // We already did this one
+ continue;
+ }
+ $seenHandlers->attach( $handler );
$handlerFields = $handler->getFieldsForSearchIndex( $this );
foreach ( $handlerFields as $fieldName => $fieldData ) {
if ( empty( $fields[$fieldName] ) ) {