On 6/8/15, S Page <sp...@wikimedia.org> wrote:
> On Mon, Jun 8, 2015 at 4:16 PM, Brian Wolff <bawo...@gmail.com> wrote:
>
>> The search api (by which I mean query=search in api.php) is somewhat
>> poorly documented. You have to dig to find
>> https://www.mediawiki.org/wiki/Help:CirrusSearch .
>
>
> I recently added https://www.mediawiki.org/wiki/API:Search_and_discovery
> which clarifies the connection with Help:CirrusSearch, and mentions other
> kinds of searching like geosearch.
>

Last I looked at the docs was about 6 months ago. Glad to hear they're
improving.

>>
>> I would much prefer
>> that the relavent documentation was including in the normal api.php
>> auto-generated help.
>
>
> https://gerrit.wikimedia.org/r/216899 changes the
> 'apihelp-query+search-param-search message' in
> https://www.mediawiki.org/wiki/Special:ApiHelp/query+search to
> *srsearch*
>
> Search for page titles and page content that match this value. You can use
> the search string to invoke special wiki search features, depending on what
> its search backend implements.
> But API query search can only use CirrusSearch features if it's installed.
> I think Extension:CirrusSearch could handle the 'APIGetAllowedParams' hook
> to modified this help text. If I understand correctly, it might be easier
> to interpose WMF-specific help text that links to mw:Help:CirrusSearch in a
> 'wikimedia-apihelp-query+search-param-search' key in
> extensions/WikimediaMessages/i18n/wikimediaoverrides/en.json ; I tried it
> locally and it didn't work.

It shouldn't be WMF specific (since its not WMF specific like TOS
links), it should be specific to CirrusSearch.

One possible implementation would be to do an override message (I
would note, that the wikimediaoverride messages aren't direct
overrides, they are replacement messages used by other code that does
the overriding). In my original email I was thinking more from a user
perspective of what I'd like to see, without thought to how it would
be implemented. Without looking at the code, I would probably favour
an extra hook just for the search module, instead of using the generic
hook.

>
>
>> Even better would be if that api allowed users to
>> specify the options using normal url parameters, (as a separate
>> options from using operators in the search string). Its also not
>> entirely the most clear from the api that the search options differ
>> depending on which extensions you have installed.
>>
>
> What do you mean? Beyone special terms in srsearch I'm not aware of any
> changes to query+search's sr parameters depending on extensions.
>

Yeah, that doesn't happen currently. I think it should be the case, it
would mesh much better with the mediawiki api if instead of doing
https://commons.wikimedia.org/w/api.php?action=query&list=search&srsearch=Black+incategory:Felis_silvestris_catus&srnamespace=6
you could do something like
https://commons.wikimedia.org/w/api.php?action=query&list=search&srincategory=Felis_silvestris_catus&srsearch=Black&srnamespace=6
. Especially if all the parameters were documented in the normal api
way, I think it would represent a big boon to discovering the hidden
features of search. (I appreciate it might be a lot of work to express
all the search options possible, but the original email sounded like
it wanted a wishlist).

--
bawolff

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to