问题
Trying to search tiles through the api using a generator. I notice that there are two possible generators, with both I have problems:
- prefix search - doesn't work well if I have multiple words and the order is reversed in the query (for example "brian adams" would return an answer, however "adams brian" does not
- search - seems to not allow searching by titles, only by text which returns low-quality results.
Anyone knows of a way around this?
回答1:
"srwhat=title" is disabled, so you should use "intitle:" in your search query:
https://en.wikipedia.org/w/api.php?action=query&list=search&srnamespace=0&srprop=timestamp&&srsearch=intitle:adams%20brian
for more info please check this page:
https://www.mediawiki.org/wiki/API:Search
来源:https://stackoverflow.com/questions/27624431/wikipedia-api-search-titles-generator