Example #1
0
  public ArrayList<String> match(String token) {
    ArrayList<String> res = new ArrayList<String>();
    if (index == null) {
      return res;
    }

    for (SearchIndex si : index) {
      if (si.match(token, caseSensitive)) {
        res.add(si.getText());
      }
    }
    return res;
  }
 /**
  * sets all attributes in XML Element from Search Index
  *
  * @param el
  * @param index
  * @throws SearchException
  */
 protected final void setAttributes(Element el, SearchIndex index) throws SearchException {
   if (el == null) return;
   setAttribute(el, "categoryTree", index.getCategoryTree());
   setAttribute(el, "category", engine.getListUtil().toList(index.getCategories(), ","));
   setAttribute(el, "custom1", index.getCustom1());
   setAttribute(el, "custom2", index.getCustom2());
   setAttribute(el, "custom3", index.getCustom3());
   setAttribute(el, "custom4", index.getCustom4());
   setAttribute(el, "id", index.getId());
   setAttribute(el, "key", index.getKey());
   setAttribute(el, "language", index.getLanguage());
   setAttribute(el, "title", index.getTitle());
   setAttribute(el, "extensions", engine.getListUtil().toList(index.getExtensions(), ","));
   setAttribute(el, "type", SearchIndexImpl.toStringType(index.getType()));
   setAttribute(el, "urlpath", index.getUrlpath());
   setAttribute(el, "query", index.getQuery());
 }
Example #3
0
 void find(SearchIndex index, String token, List<SearchItem> result) {
   index.suggest(token, result);
 }