View Javadoc

1   package com.atlassian.sal.api.search;
2   
3   /**
4    * Allows for simple string based searches in an application.  Currently this only supports String based
5    * (quicksearch type) queries, but this may be extended in the future.
6    *
7    * @since 2.0
8    */
9   public interface SearchProvider
10  {
11      /**
12       * Runs the a search given a query and returns a searchResult. The query will return as many hits as the underlying
13       * application would return by default.
14       * <p/>
15       * The searchQuery should be URLencoded, as it may contain parameters as well.  For example if a search should only
16       * return a maximum number of hits the searchQuery would be '<searchString>&maxHits=20'
17       *
18       * @param username    The user to run the search as.  May be null for anonymous searches.
19       * @param searchQuery The query to run
20       * @return A SearchResults object
21       */
22      SearchResults search(String username, String searchQuery);
23  }