Package hudson.search

Class Search

java.lang.Object
hudson.search.Search
All Implemented Interfaces:
org.kohsuke.stapler.StaplerProxy

public class Search extends Object implements org.kohsuke.stapler.StaplerProxy
Web-bound object that provides search/navigation capability.

This object is bound to "./search" of a model object via SearchableModelObject and serves HTTP requests coming from JavaScript to provide search result and auto-completion.

Author:
Kohsuke Kawaguchi
See Also:
  • Field Details

    • SKIP_PERMISSION_CHECK

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean SKIP_PERMISSION_CHECK
      Escape hatch for StaplerProxy-based access control
  • Constructor Details

    • Search

      public Search()
  • Method Details

    • doIndex

      public void doIndex(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException
      Throws:
      IOException
      jakarta.servlet.ServletException
    • doIndex

      @Deprecated @StaplerNotDispatchable public void doIndex(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • doSuggestOpenSearch

      public void doSuggestOpenSearch(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String q) throws IOException, jakarta.servlet.ServletException
      Used by OpenSearch auto-completion. Returns JSON array of the form:
       ["queryString",["comp1","comp2",...]]
       
      See http://developer.mozilla.org/en/docs/Supporting_search_suggestions_in_search_plugins
      Throws:
      IOException
      jakarta.servlet.ServletException
    • doSuggest

      public void doSuggest(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String query) throws IOException, jakarta.servlet.ServletException
      Used by search box auto-completion. Returns JSON array.
      Throws:
      IOException
      jakarta.servlet.ServletException
    • getSuggestions

      public SearchResult getSuggestions(org.kohsuke.stapler.StaplerRequest2 req, String query)
      Gets the list of suggestions that match the given query.
      Returns:
      can be empty but never null. The size of the list is always smaller than a certain threshold to avoid showing too many options.
    • getSuggestions

      @Deprecated public SearchResult getSuggestions(org.kohsuke.stapler.StaplerRequest req, String query)
    • getMaxSearchSize

      public int getMaxSearchSize()
    • find

      @Deprecated public static SuggestedItem find(SearchIndex index, String query)
    • find

      public static SuggestedItem find(SearchIndex index, String query, SearchableModelObject searchContext)
      Performs a search and returns the match, or null if no match was found or more than one match was found.
      Since:
      1.527
    • suggest

      @Deprecated public static List<SuggestedItem> suggest(SearchIndex index, String tokenList)
    • suggest

      public static List<SuggestedItem> suggest(SearchIndex index, String tokenList, SearchableModelObject searchContext)
      Since:
      1.527
    • getTarget

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Object getTarget()
      Specified by:
      getTarget in interface org.kohsuke.stapler.StaplerProxy