opensearch - filter images

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

opensearch - filter images

Luca Libonati

Hi all,
I'm using opensearch to search for images in wikimedia commons in the following way:


It seems that it is not possible to set some filters, isn't it?
Is there a way to filter images in order to have only images with a width bigger than a defined value?
If not with openserach, there's a different way?

Thank you.
Luca

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: opensearch - filter images

Gergo Tisza
Please don't use opensearch. It's meant for generic applications which implement the OpenSearch protocol (e.g. browsers which want to expose site search in their address bar for aritrary websites). Use one of the normal search APIs, like action=search or action=prefixsearch.

On Sat, Feb 4, 2017 at 2:00 PM, Luca Libonati <[hidden email]> wrote:
Is there a way to filter images in order to have only images with a width bigger than a defined value?

You can use the filesize option with normal search: https://www.mediawiki.org/wiki/Help:CirrusSearch#filesize

prefixsearch is geared for performance (real-time suggestions as you type) and has very few options.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: opensearch - filter images

Luca Libonati
ok.
Thank you.
Luca

2017-02-04 23:58 GMT+01:00 Gergo Tisza <[hidden email]>:
Please don't use opensearch. It's meant for generic applications which implement the OpenSearch protocol (e.g. browsers which want to expose site search in their address bar for aritrary websites). Use one of the normal search APIs, like action=search or action=prefixsearch.

On Sat, Feb 4, 2017 at 2:00 PM, Luca Libonati <[hidden email]> wrote:
Is there a way to filter images in order to have only images with a width bigger than a defined value?

You can use the filesize option with normal search: https://www.mediawiki.org/wiki/Help:CirrusSearch#filesize

prefixsearch is geared for performance (real-time suggestions as you type) and has very few options.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api



_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: opensearch - filter images

Luca Libonati

Hi Gergo,
is this the right way?

If so, could you help me to understand how can I set a defined size?
Moreover, I see that there is also paragraph that talk about search for specific file measures. Is this active? How could I use it?

Thank you really for your help.
Luca



2017-02-05 0:21 GMT+01:00 Luca Libonati <[hidden email]>:
ok.
Thank you.
Luca

2017-02-04 23:58 GMT+01:00 Gergo Tisza <[hidden email]>:
Please don't use opensearch. It's meant for generic applications which implement the OpenSearch protocol (e.g. browsers which want to expose site search in their address bar for aritrary websites). Use one of the normal search APIs, like action=search or action=prefixsearch.

On Sat, Feb 4, 2017 at 2:00 PM, Luca Libonati <[hidden email]> wrote:
Is there a way to filter images in order to have only images with a width bigger than a defined value?

You can use the filesize option with normal search: https://www.mediawiki.org/wiki/Help:CirrusSearch#filesize

prefixsearch is geared for performance (real-time suggestions as you type) and has very few options.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api




_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: opensearch - filter images

Gergo Tisza
On Sat, Feb 4, 2017 at 3:38 PM, Luca Libonati <[hidden email]> wrote:

It could be, although there is not much point in using a generator in itself (generators are meant to provide input for other API modules, e.g. you could add prop=imageinfo to the URL and get thumbnail URLs and whatnot for each image). If you just want to use it on its own, you can call it as action=query&format=xml&list=search&srprop=size&srsearch=london&srnamespace=6&srlimit=10&srgiprofile=wsum_inclinks&srenablerewrites=1
 
If so, could you help me to understand how can I set a defined size?
Moreover, I see that there is also paragraph that talk about search for specific file measures. Is this active? How could I use it?

For a minimum size, you'd be  using something like gsrsearch=london%20filewidth%3A%3E800 (ie. "london filewidth:>800", URLencoded).

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: opensearch - filter images

Luca Libonati
Great! It works.
Thank you really for you help.
Best,
Luca

Il giorno dom 5 feb 2017 alle 01:04 Gergo Tisza <[hidden email]> ha scritto:
It could be, although there is not much point in using a generator in itself (generators are meant to provide input for other API modules, e.g. you could add prop=imageinfo to the URL and get thumbnail URLs and whatnot for each image). If you just want to use it on its own, you can call it as action=query&format=xml&list=search&srprop=size&srsearch=london&srnamespace=6&srlimit=10&srgiprofile=wsum_inclinks&srenablerewrites=1
 
If so, could you help me to understand how can I set a defined size?
Moreover, I see that there is also paragraph that talk about search for specific file measures. Is this active? How could I use it?

For a minimum size, you'd be  using something like gsrsearch=london%20filewidth%3A%3E800 (ie. "london filewidth:>800", URLencoded).
_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Loading...