Package com.m4f.utils.search.impl

Examples of com.m4f.utils.search.impl.SearchParamsImpl


    SearchForm searchForm = new SearchForm();
    searchForm.setCollection(collection);
    try {
      if (q != null && !("").equals(q)) {
        StringTokenizer terms = new StringTokenizer(q.trim());
        SearchParamsImpl params = new SearchParamsImpl();
        params.addParam(PARAM.CLIENT, gsa_client);
        params.addParam(PARAM.SEARCH_URI, this.serviceLocator.getAppConfigurationService().
            getGlobalConfiguration().getSearchUri());
        params.addParam(PARAM.BASE_COLLECTION_NAME, collection);                       
        params.addParam(PARAM.LANG, locale.getLanguage());
        PageManager<ISearchResults> paginator = new PageManager<ISearchResults>();
        paginator.setStart((page - 1) * paginator.getOffset());
        params.addParam(PARAM.START, String.valueOf(paginator
            .getStart()));
        this.serviceLocator.getSearchEngine().search(terms, params);
        ISearchResults results = this.serviceLocator.getSearchEngine().getSearchResults();
        paginator.setCollection((Collection) results);
        try {
View Full Code Here


      if (searchForm.getQuery() == null
          || "".equals(searchForm.getQuery())) {
        return "redirect:/" + locale.getLanguage() + "/search";
      }
      StringTokenizer terms = new StringTokenizer(searchForm.getQuery().trim());
      SearchParamsImpl params = new SearchParamsImpl();
      params.addParam(PARAM.CLIENT, gsa_client);
      params.addParam(PARAM.SEARCH_URI, this.serviceLocator.getAppConfigurationService().
          getGlobalConfiguration().getSearchUri());
      params.addParam(PARAM.BASE_COLLECTION_NAME, searchForm.getCollection());
      params.addParam(PARAM.LANG, locale.getLanguage());
      PageManager<ISearchResults> paginator = new PageManager<ISearchResults>();
      paginator.setStart((page - 1) * paginator.getOffset());
      params.addParam(PARAM.START, String.valueOf(paginator.getStart()));
      this.serviceLocator.getSearchEngine().search(terms, params);
      ISearchResults results = this.serviceLocator.getSearchEngine().getSearchResults();
      paginator.setCollection((Collection) results);
      try {
        paginator.setSize(Long.parseLong(results.getTotalResults()));
View Full Code Here

      StringTokenizer terms =  new StringTokenizer("");
      if(searchForm.getQuery() != null && !("").equals(searchForm.getQuery())) {
        terms = new StringTokenizer(searchForm.getQuery().trim());
      }
      
      SearchParamsImpl params = new SearchParamsImpl();
      params.addParam(PARAM.CLIENT, gsa_client);
      params.addParam(PARAM.SEARCH_URI, this.serviceLocator.getAppConfigurationService().
          getGlobalConfiguration().getSearchUri());
      params.addParam(PARAM.BASE_COLLECTION_NAME, this.serviceLocator.getAppConfigurationService().
          getGlobalConfiguration().getSearchBaseCollectionName());   
      params.addParam(PARAM.LANG, locale.getLanguage());
      if(searchForm.getInMeta() != null && !"".equals(searchForm.getInMeta())) {
        String urlEndodedField = URLEncoder.encode(searchForm.getInMeta(), "UTF-8"); // Url encoding
        params.addParam(PARAM.INMETA, urlEndodedField);
        //query = new StringBuffer(query).append("".equals(query) ? "" : " ").append(searchForm.getInMeta()).toString();
      }
      //params.addParam(PARAM.START, start != null ? start.toString() : "");
     
      PageManager<ISearchResults> paginator = new PageManager<ISearchResults>();
      paginator.setStart((page-1)*paginator.getOffset());
      params.addParam(PARAM.START, String.valueOf(paginator.getStart()));
      this.serviceLocator.getSearchEngine().search(terms, params);
      ISearchResults results = this.serviceLocator.getSearchEngine().getSearchResults();
      paginator.setCollection((Collection)results);
      try {
        paginator.setSize(Long.parseLong(results.getTotalResults()));
View Full Code Here

TOP

Related Classes of com.m4f.utils.search.impl.SearchParamsImpl

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.