Package org.apache.wiki.search
Class DefaultSearchManager.JSONSearch
java.lang.Object
org.apache.wiki.search.DefaultSearchManager.JSONSearch
- All Implemented Interfaces:
WikiAjaxServlet
- Enclosing class:
- DefaultSearchManager
public class DefaultSearchManager.JSONSearch extends Object implements WikiAjaxServlet
Provides a JSON AJAX API to the JSPWiki Search Engine.
-
Field Summary
Fields Modifier and Type Field Description static StringAJAX_ACTION_PAGESstatic StringAJAX_ACTION_SUGGESTIONSstatic intDEFAULT_MAX_RESULTSintmaxResults -
Constructor Summary
Constructors Constructor Description JSONSearch() -
Method Summary
Modifier and Type Method Description List<Map<String,Object>>findPages(String searchString, int maxLength, Context wikiContext)Performs a full search of pages.StringgetServletMapping()List<String>getSuggestions(String wikiName, int maxLength)Provides a list of suggestions to use for a page name.voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String actionName, List<String> params)
-
Field Details
-
AJAX_ACTION_SUGGESTIONS
- See Also:
- Constant Field Values
-
AJAX_ACTION_PAGES
- See Also:
- Constant Field Values
-
DEFAULT_MAX_RESULTS
- See Also:
- Constant Field Values
-
maxResults
-
-
Constructor Details
-
JSONSearch
public JSONSearch()
-
-
Method Details
-
getServletMapping
- Specified by:
getServletMappingin interfaceWikiAjaxServlet
-
service
public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String actionName, List<String> params) throws IOException- Specified by:
servicein interfaceWikiAjaxServlet- Throws:
IOException
-
getSuggestions
Provides a list of suggestions to use for a page name. Currently the algorithm just looks into the value parameter, and returns all page names from that.- Parameters:
wikiName- the page namemaxLength- maximum number of suggestions- Returns:
- the suggestions
-
findPages
public List<Map<String,Object>> findPages(String searchString, int maxLength, Context wikiContext)Performs a full search of pages.- Parameters:
searchString- The query stringmaxLength- How many hits to return- Returns:
- the pages found
-