About fetching pageID with generator module on list=search,

could you please debrief? 

I ll try to be more specific.

I understood that generators take a list of titles, and I would like to return the pageID of titles in that list.

But cannot get it to work, it looks like generators gives another output, although in documentation is written it doesn't.

As example, I query "DJ Tiesto" with list=search.

Then use generator=allpages with indexpageids selected.

Results in query['search'] are relevant; the pageIDs in query['pageids'] are not related to the list titles:

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&list=search&format=json&srsearch=dj%20tiesto&srprop=snippet%7Ctitlesnippet&indexpageids=&generator=allpages&gapcontinue=nextPage&gapfilterredir=nonredirects&gapdir=ascending

How to have items in query['search'] completed with pageIds along their snippet, or a dictionary of matching tiltes ?


Searching with a generator=search (and not list=search) will work.

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&prop=extracts|redirects&format=json&rdprop=pageid%7Ctitle&indexpageids=&generator=search&gsrsearch=dj%20tiesto

I don't understand how the two (generator=search and list=search) work.