AMO:Users/Search API: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with '== Search API == The new Search API uses Sphinx to power it's results. In addition to sphinx we have a custom query language that is meant to be human readable. === General sy…')
 
No edit summary
Line 1: Line 1:
== Search API ==
== Search API ==


The new Search API uses Sphinx to power it's results. In addition to sphinx we have a custom query language that is meant to be human readable.  
The new Search API uses Sphinx to power it's results. In addition to sphinx we have a custom query language that is meant to be human readable.  


=== General syntax ===
=== General syntax ===


The general syntax for a query is as such:  
The general syntax for a query is as such:  


http://support.addons.mozilla.org/[locale]/[app]/api/1.5/search/[query]  
<pre>http://support.addons.mozilla.org/[locale]/[app]/api/1.5/search/[query] </pre>


where locale is something like 'en-US' or 'fr'<br>where app is something like 'firefox' or 'thunderbird'<br>where query is the actual search query  
where locale is something like 'en-US' or 'fr'<br>where app is something like 'firefox' or 'thunderbird'<br>where query is the actual search query  


=== Query syntax ===
=== Query syntax ===


The query syntax supports straightforward searches like yslow should bring up the yslow addon. Additionally there are a few filters you can use to fine-tune your results.  
The query syntax supports straightforward searches like yslow should bring up the yslow addon. Additionally there are a few filters you can use to fine-tune your results.  


==== Category filters ====
==== Category filters ====


If you wish to filter your query by a specific category you can by doing the following:  
If you wish to filter your query by a specific category you can by doing the following:  


[query] category:[category short name]  
<pre>[query] category:[category short name] </pre>


Where [category short name] is the first word of a category name (in en-US) e.g. "alerts" is "Alerts &amp; Updates"  
Where [category short name] is the first word of a category name (in en-US) e.g. "alerts" is "Alerts &amp; Updates"  
Line 25: Line 25:
For example:  
For example:  


yslow category:alerts  
<pre>yslow category:alerts </pre>


will look for addons matching "yslow" in the category "Alerts &amp; Updates"  
will look for addons matching "yslow" in the category "Alerts &amp; Updates"  


==== Tag filters ====
==== Tag filters ====


If you wish to filter your query by a specific tag you can by doing the following:  
If you wish to filter your query by a specific tag you can by doing the following:  


[query] tag:[tag]  
<pre>[query] tag:[tag] </pre>


Where [tag] is the tag.  
Where [tag] is the tag.  
Line 39: Line 39:
For example:  
For example:  


yslow tag:webdev  
<pre>yslow tag:webdev </pre>


will look for addons matching "yslow" tagged as "webdev"  
will look for addons matching "yslow" tagged as "webdev"  


==== Version filters ====
==== Version filters ====


If you wish to look for addons that support a specific version of Firefox/Thunderbird/Sunbird/etc:<br>[query] version:[version]  
If you wish to look for addons that support a specific version of Firefox/Thunderbird/Sunbird/etc:<br>[query] version:[version]  
Line 51: Line 51:
For example:  
For example:  


yslow version:3.5  
<pre>yslow version:3.5 </pre>


will look for addons matching "yslow" that are supported in version 3.5 of the select application i.e. if you are in /en-US/firefox then this will work in version 3.5 of firefox.  
will look for addons matching "yslow" that are supported in version 3.5 of the select application i.e. if you are in /en-US/firefox then this will work in version 3.5 of firefox.  


==== Type filters ====
==== Type filters ====


If you wish to look for addons of a specific type (e.g. extension, theme, etc) you can use the following syntax:<br>[query] type:[type]  
If you wish to look for addons of a specific type (e.g. extension, theme, etc) you can use the following syntax:
 
<pre>[query] type:[type] </pre>


Where [type] is the addon type e.g. plugin, extension, theme, etc  
Where [type] is the addon type e.g. plugin, extension, theme, etc  
Line 63: Line 65:
For example:  
For example:  


yslow type:theme  
<pre>yslow type:theme </pre>


will look for addons matching "yslow" that are themes.  
will look for addons matching "yslow" that are themes.  


==== Platform filters ====
==== Platform filters ====


If you wish to look for addons that work on a specific platform (linux, mac, etc)<br>[query] platform:[type]  
If you wish to look for addons that work on a specific platform (linux, mac, etc)
 
<pre>[query] platform:[type] </pre>


Where [platform] is the OS in which you'd like to run the addon  
Where [platform] is the OS in which you'd like to run the addon  
Line 75: Line 79:
For example:  
For example:  


yslow platform:mac  
<pre>yslow platform:mac </pre>


will look for addons matching "yslow" that will run on the Mac OS platform.  
will look for addons matching "yslow" that will run on the Mac OS platform.  


==== Date filter ====
==== Date filter ====
 
If you wish to look for addons that were updated after a certain date


If you wish to look for addons that were updated after a certain date<br>[query] after:[YYYY-MM-DD]  
<pre>[query] after:[YYYY-MM-DD]</pre>


Where [YYYY-MM-DD] is the date format  
Where [YYYY-MM-DD] is the date format  
Line 87: Line 93:
For example:  
For example:  


yslow after:2008-03-04  
<pre>yslow after:2008-03-04 </pre>


will look for addons matching "yslow" that were updated after 4 March 2008.
will look for addons matching "yslow" that were updated after 4 March 2008.

Revision as of 20:57, 18 August 2009

Search API

The new Search API uses Sphinx to power it's results. In addition to sphinx we have a custom query language that is meant to be human readable.

General syntax

The general syntax for a query is as such:

http://support.addons.mozilla.org/[locale]/[app]/api/1.5/search/[query] 

where locale is something like 'en-US' or 'fr'
where app is something like 'firefox' or 'thunderbird'
where query is the actual search query

Query syntax

The query syntax supports straightforward searches like yslow should bring up the yslow addon. Additionally there are a few filters you can use to fine-tune your results.

Category filters

If you wish to filter your query by a specific category you can by doing the following:

[query] category:[category short name] 

Where [category short name] is the first word of a category name (in en-US) e.g. "alerts" is "Alerts & Updates"

For example:

yslow category:alerts 

will look for addons matching "yslow" in the category "Alerts & Updates"

Tag filters

If you wish to filter your query by a specific tag you can by doing the following:

[query] tag:[tag] 

Where [tag] is the tag.

For example:

yslow tag:webdev 

will look for addons matching "yslow" tagged as "webdev"

Version filters

If you wish to look for addons that support a specific version of Firefox/Thunderbird/Sunbird/etc:
[query] version:[version]

Where [version] is the version number e.g. 1.0,2.0,3.5.

For example:

yslow version:3.5 

will look for addons matching "yslow" that are supported in version 3.5 of the select application i.e. if you are in /en-US/firefox then this will work in version 3.5 of firefox.

Type filters

If you wish to look for addons of a specific type (e.g. extension, theme, etc) you can use the following syntax:

[query] type:[type] 

Where [type] is the addon type e.g. plugin, extension, theme, etc

For example:

yslow type:theme 

will look for addons matching "yslow" that are themes.

Platform filters

If you wish to look for addons that work on a specific platform (linux, mac, etc)

[query] platform:[type] 

Where [platform] is the OS in which you'd like to run the addon

For example:

yslow platform:mac 

will look for addons matching "yslow" that will run on the Mac OS platform.

Date filter

If you wish to look for addons that were updated after a certain date

[query] after:[YYYY-MM-DD]

Where [YYYY-MM-DD] is the date format

For example:

yslow after:2008-03-04 

will look for addons matching "yslow" that were updated after 4 March 2008.