[MediaWiki-l] Customizing how search results are displayed/adding content to search results

Brian Wolff bawolff at gmail.com
Mon Aug 14 17:12:00 UTC 2017


The code for searching is split between the stuff in includes/search,
includes/specials/SpecialSearch.php and includes/widgets/search.

Im not all that familar with the search code, so ymmv. I guess what you
would want to do is have a custom SearchEngine subclass, which would return
a custom SearchResultSet subclass which would return a custom SearchResult
subclass which adds additional html to the output in getTextSnippet().

There is also the SearchResultsAugment hook, which seems relavent to your
usecase, but it seems more for collecting extra data not displaying it.

--
Bawolff

On Monday, August 14, 2017, George, Garrett J. (JSC-CB111)[SGT, INC] <
garrett.j.george at nasa.gov> wrote:
> Hey all,
>
> I work on a wiki that incorporates a lot of templates and properties from
SMW and I've been trying to figure out how best to add this type of
information to the existing search results.
>
> My big two questions are:
>
> 1.       Does CirrusSearch handle HTML generation for visually printing
search results or does it simply hand off the results to MW for printing?
>
> 2.       In either case, where can I find the code that does the HTML
printing of search results in order to tack on more information about each
search result?
>
> Thanks,
>
> Garrett
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


More information about the MediaWiki-l mailing list