I have an extension using the ArticleFromTitle hook to generate pages for components of a large system we operate. There are approximately 6000 components at the moment with static inventory and config data in a database and live status data in a number of other systems. We are using MediaWiki as a historical maintenance knowledge-base for the staff. With this extension, we can integrate all the data for each device in one place. We can hit MyNS:DeviceName and get a page that describes a device and that page can link to other pages in the main namespace that techs create with vendor details, model info, manuals, etc. We can even keep a talk page for each device. Very handy.
Trouble now is I want to be able to find devices using the search feature. SpecialSearchResults looked promising but that only gets called when there is at least one match in "normal" pages. So, I looked at SpecialSearchNoResults but that doesn't allow me to add to the empty results. Doesn't anyone have a suggestion on how I could go about this? I really want to avoid generating the text of pages externally periodically and loading them into the wiki using the importTextFile maintenance script.
The only other thought I had was to extend the SearchMySQL class and change $wgSearchType but I'm hoping to avoid that.
Any ideas?
--Paul
SpecialSearchResultsPrepend lets you add html directly to the search page but doesn't let you add your own results. The html actually gets injected above the search for so it'd take some css trickery to move it. Example: "This wiki is using a new search engine. (Learn morehttps://www.mediawiki.org/wiki/Special:MyLanguage/Help:CirrusSearch)" on https://www.mediawiki.org/wiki/Special:Search
Beyond that I think you have three options: 1. Extend SearchMySQL. 2. Add a hook yourself and know that you are running a patched version of core. I'm happy to help get the patch upstream if you don't want to live with that burden forever. 3. Add that pages with importTextFile.
Nik
On Thu, Dec 12, 2013 at 9:15 PM, Paul Dugas paul@dugasenterprises.comwrote:
I have an extension using the ArticleFromTitle hook to generate pages for components of a large system we operate. There are approximately 6000 components at the moment with static inventory and config data in a database and live status data in a number of other systems. We are using MediaWiki as a historical maintenance knowledge-base for the staff. With this extension, we can integrate all the data for each device in one place. We can hit MyNS:DeviceName and get a page that describes a device and that page can link to other pages in the main namespace that techs create with vendor details, model info, manuals, etc. We can even keep a talk page for each device. Very handy.
Trouble now is I want to be able to find devices using the search feature. SpecialSearchResults looked promising but that only gets called when there is at least one match in "normal" pages. So, I looked at SpecialSearchNoResults but that doesn't allow me to add to the empty results. Doesn't anyone have a suggestion on how I could go about this? I really want to avoid generating the text of pages externally periodically and loading them into the wiki using the importTextFile maintenance script.
The only other thought I had was to extend the SearchMySQL class and change $wgSearchType but I'm hoping to avoid that.
Any ideas?
--Paul
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Thanks Nikolas. I found SpecialSearchResultsPrepend and SpecialSearchResultsAppend looking through the code though I didn't see them in the documentation. I implemented the later to add a section below the standard search results that lists results from my system. Seems to be working for now and requires no patching of the core code.
P
On Fri, Dec 13, 2013 at 8:55 AM, Nikolas Everett neverett@wikimedia.orgwrote:
SpecialSearchResultsPrepend lets you add html directly to the search page but doesn't let you add your own results. The html actually gets injected above the search for so it'd take some css trickery to move it. Example: "This wiki is using a new search engine. (Learn more<https://www.mediawiki.org/wiki/Special:MyLanguage/Help:CirrusSearch
)"
on https://www.mediawiki.org/wiki/Special:Search
Beyond that I think you have three options:
- Extend SearchMySQL.
- Add a hook yourself and know that you are running a patched version of
core. I'm happy to help get the patch upstream if you don't want to live with that burden forever. 3. Add that pages with importTextFile.
Nik
On Thu, Dec 12, 2013 at 9:15 PM, Paul Dugas <paul@dugasenterprises.com
wrote:
I have an extension using the ArticleFromTitle hook to generate pages for components of a large system we operate. There are approximately 6000 components at the moment with static inventory and config data in a database and live status data in a number of other systems. We are using MediaWiki as a historical maintenance knowledge-base for the staff. With this extension, we can integrate all the data for each device in one place. We can hit MyNS:DeviceName and get a page that describes a device and that page can link to other pages in the main namespace that techs create with vendor details, model info, manuals, etc. We can even keep a talk page for each device. Very handy.
Trouble now is I want to be able to find devices using the search feature. SpecialSearchResults looked promising but that only gets called when there is at least one match in "normal" pages. So, I looked at SpecialSearchNoResults but that doesn't allow me to add to the empty results. Doesn't anyone have a suggestion on how I could go about this? I really want to avoid generating the text of pages externally periodically and loading them into the wiki using the importTextFile maintenance script.
The only other thought I had was to extend the SearchMySQL class and change $wgSearchType but I'm hoping to avoid that.
Any ideas?
--Paul
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Glad to hear it! I hadn't seen SpecialSearchResultsAppend before. Unesful.
On Fri, Dec 13, 2013 at 9:02 AM, Paul Dugas paul@dugasenterprises.comwrote:
Thanks Nikolas. I found SpecialSearchResultsPrepend and SpecialSearchResultsAppend looking through the code though I didn't see them in the documentation. I implemented the later to add a section below the standard search results that lists results from my system. Seems to be working for now and requires no patching of the core code.
P
On Fri, Dec 13, 2013 at 8:55 AM, Nikolas Everett <neverett@wikimedia.org
wrote:
SpecialSearchResultsPrepend lets you add html directly to the search page but doesn't let you add your own results. The html actually gets
injected
above the search for so it'd take some css trickery to move it. Example: "This wiki is using a new search engine. (Learn more<https://www.mediawiki.org/wiki/Special:MyLanguage/Help:CirrusSearch
)"
on https://www.mediawiki.org/wiki/Special:Search
Beyond that I think you have three options:
- Extend SearchMySQL.
- Add a hook yourself and know that you are running a patched version
of
core. I'm happy to help get the patch upstream if you don't want to live with that burden forever. 3. Add that pages with importTextFile.
Nik
On Thu, Dec 12, 2013 at 9:15 PM, Paul Dugas <paul@dugasenterprises.com
wrote:
I have an extension using the ArticleFromTitle hook to generate pages for components of a large system we operate. There are approximately 6000 components at the moment with static inventory and config data in a database and live status data in a number of other systems. We are using MediaWiki as a historical maintenance knowledge-base for the staff. With this extension, we can integrate all the data for each device in one place. We can hit MyNS:DeviceName and get a page that describes a device and that page can link to other pages in the main namespace that techs create with vendor details, model info, manuals, etc. We can even keep a talk page for each device. Very handy.
Trouble now is I want to be able to find devices using the search feature. SpecialSearchResults looked promising but that only gets called when there is at least one match in "normal" pages. So, I looked at SpecialSearchNoResults but that doesn't allow me to add to the empty results. Doesn't anyone have a suggestion on how I could go about this? I really want to avoid generating the text of pages externally periodically and loading them into the wiki using the importTextFile maintenance script.
The only other thought I had was to extend the SearchMySQL class and change $wgSearchType but I'm hoping to avoid that.
Any ideas?
--Paul
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
--
*Paul Dugas* • *Dugas Enterprises, LLC* • *Computer Engineer*
Paul@DugasEnterprises.com paul@dugasenterprises.com • +1.404.932.1355
522 Black Canyon Park, Canton GA 30114 USA _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Thu, Dec 12, 2013 at 9:15 PM, Paul Dugas paul@dugasenterprises.comwrote:
So, I looked at SpecialSearchNoResults but that doesn't allow me to add to the empty results.
Maybe it should.
I added SpecialSearchResultsAppend and SpecialSearchResultsPrepend to Manual:Hooks. Feel free to add any other hooks you come across that are missing from that page. :-)
wikitech-l@lists.wikimedia.org