public void doSuggestOpenSearch(StaplerRequest req, StaplerResponse rsp, @QueryParameter String q) throws IOException, ServletException {
        rsp.setContentType(Flavor.JSON.contentType);
        DataWriter w = Flavor.JSON.createDataWriter(null, rsp);
        w.startArray();
        w.value(q);

        w.startArray();
        for (SuggestedItem item : getSuggestions(req, q))
            w.value(item.getPath());
        w.endArray();
        w.endArray();
    }
public void doSuggestOpenSearch ( StaplerRequest req , StaplerResponse rsp , @ QueryParameter String q ) throws IOException , ServletException { rsp . setContentType ( Flavor . JSON . contentType ) ; DataWriter w = Flavor . JSON . createDataWriter ( null , rsp ) ; w . startArray ( ) ; w . value ( q ) ; w . startArray ( ) ; for ( SuggestedItem item : getSuggestions ( req , q ) ) w . value ( item . getPath ( ) ) ; w . endArray ( ) ; w . endArray ( ) ; }
Used by OpenSearch auto-completion. Returns JSON array of the form:

<pre>
["queryString",["comp1","comp2",...]]
</pre>

See http://developer.mozilla.org/en/docs/Supporting_search_suggestions_in_search_plugins