-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
As we're getting more of the enhanced Lucene search server's capabilities exposed to the web UI, it might be good if we can make sure they're exposed to the API as well.
I received a request recently specifically about the "did you mean" feature for spelling corrections of search terms. Internally this is exposed as the hasSuggestion(), getSuggestionQuery(), and getSuggestionSnippet() methods on the search result set object for search engine backends that support it.
Being able to return this via the API could be rather handy...
Do we have a standard way to return a query-specific bit of metadata with the alternate search term suggestion as well as the list of individual results?
- -- brion
IMHO we can just add another element next to <search>, like <searchSuggestions>
http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=... returns
<api> ... <query> <search> <p ns="0" title="Meaning" /> <p ns="0" title="Semantics" /> ... </search> <searchSuggestions> <s>suggestion1</s> <s>suggestion2</s> </searchSuggestions> ...
On Sun, Nov 16, 2008 at 9:00 PM, Brion Vibber brion@wikimedia.org wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
As we're getting more of the enhanced Lucene search server's capabilities exposed to the web UI, it might be good if we can make sure they're exposed to the API as well.
I received a request recently specifically about the "did you mean" feature for spelling corrections of search terms. Internally this is exposed as the hasSuggestion(), getSuggestionQuery(), and getSuggestionSnippet() methods on the search result set object for search engine backends that support it.
Being able to return this via the API could be rather handy...
Do we have a standard way to return a query-specific bit of metadata with the alternate search term suggestion as well as the list of individual results?
- -- brion
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkg0DsACgkQwRnhpk1wk46YtwCfXagP/ulHKhbPewFHhK3/m77O atEAniP/891lp+qfFBQtJIwEV7HqdG8s =WSCv -----END PGP SIGNATURE-----
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Brion Vibber schreef:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
As we're getting more of the enhanced Lucene search server's capabilities exposed to the web UI, it might be good if we can make sure they're exposed to the API as well.
I received a request recently specifically about the "did you mean" feature for spelling corrections of search terms. Internally this is exposed as the hasSuggestion(), getSuggestionQuery(), and getSuggestionSnippet() methods on the search result set object for search engine backends that support it.
Being able to return this via the API could be rather handy...
I'll try to poke at this some time this week, although I can't make any promises (I've been busy lately, there's virtually no time left for me to do MW stuff on Mon-Thu).
Do we have a standard way to return a query-specific bit of metadata with the alternate search term suggestion as well as the list of individual results?
No. I'll invent one :) Yuri's suggestion looks good, although I'm wary of CamelCase in XML tags (but that's just a minor detail). I'll probably make this optional through srprop=suggestions.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org