Hi,
When looking at the documentation you get when callling the API, the apprefix parameter is documented as "Search for all page titles that begin with this value" but I don't get any result when I try to use it.
For example, the following request returns zero pages : http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi...
How do you use apprefix ?
Nico
Nicolas Vervelle schreef:
Hi,
When looking at the documentation you get when callling the API, the apprefix parameter is documented as "Search for all page titles that begin with this value" but I don't get any result when I try to use it.
For example, the following request returns zero pages : http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi...
How do you use apprefix ?
Leave out the apfrom parameter, or set it to Bal rather than bal.
http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi... and http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi...
both work.
Roan Kattouw (Catrope)
Hi again,
I forgot one question : would it be possible to add an other parameter than apprefix to search all titles containing a given word, not only titles begining with a given word ? That would be very helpful for me (writing a tool to fix red links by searching for an existing article that could be used instead).
Nico
Nicolas Vervelle a écrit :
Roan Kattouw a écrit :
Nicolas Vervelle schreef:
Hi,
When looking at the documentation you get when callling the API, the apprefix parameter is documented as "Search for all page titles that begin with this value" but I don't get any result when I try to use it.
For example, the following request returns zero pages : http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi...
How do you use apprefix ?
Leave out the apfrom parameter, or set it to Bal rather than bal.
http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi... and http://en.wikipedia.org/w/api.php?action=query&list=allpages&apprefi...
both work.
Roan Kattouw (Catrope)
Thanks a lot,
how stupid of me, I did my first test only with apprefix but value bal not Bal ...
Nico
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Nicolas Vervelle schreef:
Hi again,
I forgot one question : would it be possible to add an other parameter than apprefix to search all titles containing a given word, not only titles begining with a given word ? That would be very helpful for me (writing a tool to fix red links by searching for an existing article that could be used instead).
Nico
To search in titles, use list=search&srwhat=title
Roan Kattouw (Catrope)
Roan Kattouw a écrit :
Nicolas Vervelle schreef:
Hi again,
I forgot one question : would it be possible to add an other parameter than apprefix to search all titles containing a given word, not only titles begining with a given word ? That would be very helpful for me (writing a tool to fix red links by searching for an existing article that could be used instead).
Nico
To search in titles, use list=search&srwhat=title
Roan Kattouw (Catrope)
Thanks, but it doesn't seem to work.
I tried the 3 examples provided at http://en.wikipedia.org/w/api.php and they all end up with empty results : http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=... http://en.wikipedia.org/w/api.php?action=query&list=search&srwhat=te... http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrs...
Nico
On Jan 14, 2008 8:07 PM, Nicolas Vervelle nvervelle@numericable.fr wrote:
Roan Kattouw a écrit :
Nicolas Vervelle schreef:
Hi again,
I forgot one question : would it be possible to add an other parameter than apprefix to search all titles containing a given word, not only titles begining with a given word ? That would be very helpful for me (writing a tool to fix red links by searching for an existing article that could be used instead).
Nico
To search in titles, use list=search&srwhat=title
Roan Kattouw (Catrope)
Thanks, but it doesn't seem to work.
I tried the 3 examples provided at http://en.wikipedia.org/w/api.php and they all end up with empty results : http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=... http://en.wikipedia.org/w/api.php?action=query&list=search&srwhat=te... http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrs...
Nico
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
That's because Wikimedia uses the Lucene search background, which does not work with the API yet.
Bryan
Bryan Tong Minh a écrit :
On Jan 14, 2008 8:07 PM, Nicolas Vervelle nvervelle@numericable.fr wrote:
Roan Kattouw a écrit :
Nicolas Vervelle schreef:
Hi again,
I forgot one question : would it be possible to add an other parameter than apprefix to search all titles containing a given word, not only titles begining with a given word ? That would be very helpful for me (writing a tool to fix red links by searching for an existing article that could be used instead).
Nico
To search in titles, use list=search&srwhat=title
Roan Kattouw (Catrope)
Thanks, but it doesn't seem to work.
I tried the 3 examples provided at http://en.wikipedia.org/w/api.php and they all end up with empty results : http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=... http://en.wikipedia.org/w/api.php?action=query&list=search&srwhat=te... http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrs...
Nico
That's because Wikimedia uses the Lucene search background, which does not work with the API yet.
Bryan
Ok, thanks for the answer.
So, I am back with my suggestion for an other parameter for allpages query giving the ability to find all titles containing a given word (which sould be easy to implement, seeing how apprefix is implemented).
Nico
Nicolas Vervelle schreef:
Ok, thanks for the answer. So, I am back with my suggestion for an other parameter for allpages query giving the ability to find all titles containing a given word (which sould be easy to implement, seeing how apprefix is implemented).
It's not. Apprefix benefits from special DB optimizations because it only searches in the first characters. Other searches aren't as optimized. Also note that Lucene is planned to be made API-friendly some day.
Roan Kattouw (Catrope)
Roan Kattouw a écrit :
Nicolas Vervelle schreef:
Ok, thanks for the answer. So, I am back with my suggestion for an other parameter for allpages query giving the ability to find all titles containing a given word (which sould be easy to implement, seeing how apprefix is implemented).
It's not. Apprefix benefits from special DB optimizations because it only searches in the first characters. Other searches aren't as optimized. Also note that Lucene is planned to be made API-friendly some day.
Roan Kattouw (Catrope)
Ok, understood, I will wait until it becomes available.
Thanks for your help.
mediawiki-api@lists.wikimedia.org