Package hudson.search
Class Search
java.lang.Object
hudson.search.Search
- All Implemented Interfaces:
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:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
Escape hatch for StaplerProxy-based access control -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doIndex
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) void
doIndex
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Deprecated.void
doSuggest
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String query) Used by search box auto-completion.void
doSuggestOpenSearch
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String q) Used by OpenSearch auto-completion.static SuggestedItem
find
(SearchIndex index, String query) Deprecated.Usefind(SearchIndex, String, SearchableModelObject)
instead.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.int
getSuggestions
(org.kohsuke.stapler.StaplerRequest2 req, String query) Gets the list of suggestions that match the given query.getSuggestions
(org.kohsuke.stapler.StaplerRequest req, String query) Deprecated.static List<SuggestedItem>
suggest
(SearchIndex index, String tokenList) Deprecated.usesuggest(SearchIndex, String, SearchableModelObject)
instead.static List<SuggestedItem>
suggest
(SearchIndex index, String tokenList, SearchableModelObject searchContext)
-
Field Details
-
SKIP_PERMISSION_CHECK
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean SKIP_PERMISSION_CHECKEscape 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 Deprecated.- 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
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) Deprecated. -
getMaxSearchSize
public int getMaxSearchSize() -
find
Deprecated.Usefind(SearchIndex, String, SearchableModelObject)
instead. -
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.usesuggest(SearchIndex, String, SearchableModelObject)
instead. -
suggest
public static List<SuggestedItem> suggest(SearchIndex index, String tokenList, SearchableModelObject searchContext) - Since:
- 1.527
-
getTarget
- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
-
doIndex(StaplerRequest2, StaplerResponse2)