AMO:Users/Search API: Difference between revisions

(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…')
 
 
(3 intermediate revisions by 2 users not shown)
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 its 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://services.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', 'thunderbird', 'sunbird', 'seamonkey', or 'fennec'<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:
 
<pre>[query] version:[version] </pre>


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


For example:  
For example:  
<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.


yslow version:3.5
==== Type filters  ====
 
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:


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]  
<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)


If you wish to look for addons that work on a specific platform (linux, mac, etc)<br>[query] platform:[type]  
<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.
142

edits