Package de.metalcon.autocompleteServer.Helper.SuggestTree

Examples of de.metalcon.autocompleteServer.Helper.SuggestTree.Node


   * @param numItems
   */
  private static void retrieveSuggestions(HttpServletRequest request,
      ProcessRetrieveResponse response, SuggestTree index, String term,
      Integer numItems) {
    Node suggestions = index.getBestSuggestions(term);
    System.out.println(index.size() + " , " + suggestions.listLength());
    if (suggestions == null) {
      response.addError(RetrieveStatusCodes.NO_SUGGESTIONS_MATCHING_TERM);
      return;
    }
    for (int i = 0; i < Math.min(suggestions.listLength(), numItems); ++i) {
      String suggestString = suggestions.getSuggestion(i);
      String key = suggestions.getKey(i);
      response.addSuggestion(suggestString, key);
    }
  }
View Full Code Here

TOP

Related Classes of de.metalcon.autocompleteServer.Helper.SuggestTree.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.