Ben Ritter wrote:
As you only want to display a small amount of text from each page you could get just the text you need from each page and send them all together with some sort of separator to http://en.wikipedia.org/w/api.php?action=parse&format=xml&text=This is some [[text]] to parse Of course this turns "[[text]]" into an html anchor tag and expands templates. If this is not what you want, stripping the text yourself would probably be the best.
I don't know if that won't work so well ... since you never now what part of a template or table or some larger wikitext structure your at when you match some segment of text. JS striping the wikitext is not so fun.. since has to deal with multiple languages and is duplicating code that already exist in the php ... see SearchUPdate::doUpdate() ... better to have all those regEx in one place ... although we could do that in js as a hack in the mean time ...
But in the end I think serving the (more) human readable text thats used for full text searches directly to the api would be ideal...
--michael