Package org.fao.geonet.kernel.search

Examples of org.fao.geonet.kernel.search.MetaSearcher.search()


    ServiceConfig config = new ServiceConfig();

    SearchManager searchMan = gc.getBean(SearchManager.class);
    MetaSearcher  searcher  = searchMan.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);

    searcher.search(context, params, config);

    params.addContent(new Element("from").setText("1"));
    params.addContent(new Element("to").setText(searcher.getSize() +""));

    Element result = searcher.present(context, params, config);
View Full Code Here


    MetaSearcher searcher = sm.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);

        if(context.isDebugEnabled()) context.debug("Searching with params:\n"+ Xml.getString(params));

    searcher.search(context, params, dummyConfig);

    params.addContent(new Element("fast").setText("true"));
    params.addContent(new Element("from").setText("1"));
    params.addContent(new Element("to").setText(searcher.getSize() +""));
View Full Code Here

    request.addContent(new Element(Geonet.SearchResult.TIMEOUT).setText("100"))
    // --- set hitsPerPage
    request.addContent(new Element(Geonet.SearchResult.HITS_PER_PAGE).setText(groupSize+""))

    // --- do the search
    s.search(context, request, config);

    if (s.getSize() == 0) {
      log.error("Search failed or returned 0 results, trying again");
      s.search(context, request, config);
      if (s.getSize() == 0) {
View Full Code Here

    // --- do the search
    s.search(context, request, config);

    if (s.getSize() == 0) {
      log.error("Search failed or returned 0 results, trying again");
      s.search(context, request, config);
      if (s.getSize() == 0) {
        throw new Exception("Bad luck, Search failed or returned 0 results");
      }
    }
View Full Code Here

            parameters.addContent(new Element("sortBy").addContent("title"));
            parameters.addContent(new Element("sortOrder").addContent("reverse"));
            parameters.addContent(new Element("from").addContent(from));
            parameters.addContent(new Element("to").addContent(to));

            searcher.search(context, parameters, _config);

            Element response = new Element(type);
            Element relatedElement = searcher.present(context, parameters, _config);
            response.addContent(relatedElement);
            return response;
View Full Code Here

        searchRequest.addContent(new Element("westBL").setText(_westBL));
 
                if(Log.isDebugEnabled(Geonet.SEARCH_ENGINE))
            Log.debug(Geonet.SEARCH_ENGINE, "RANDOM SEARCH CRITERIA:\n"+ Xml.getString(searchRequest));
       
        searcher.search(context, searchRequest, _config);
 
        Element presentRequest = new Element("request");
        presentRequest.addContent(new Element("fast").setText("true"));
        presentRequest.addContent(new Element("from").setText("1"));
        presentRequest.addContent(new Element("to").setText(searcher.getSize()+""));
View Full Code Here

      _response = new Element(Jeeves.Elem.RESPONSE);

      // perform the search and return the results read from the index
      Log.info(Geonet.SEARCH_ENGINE, "Creating latest updates searcher");
      MetaSearcher searcher = searchMan.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);
      searcher.search(context, _request, _config);
      Map<Integer,Metadata> allMdInfo = ((LuceneSearcher)searcher).getAllMdInfo(context, _maxItems);
      for (Integer id : allMdInfo.keySet()) {
        try {
          boolean forEditing = false;
          boolean withValidationErrors = false;
View Full Code Here

        Geonet.File.SEARCH_LUCENE);

    Set<String> uuids = new HashSet<String>();

    // perform the search
    searcher.search(context, request, _config);

    // If element type found, then get their uuid
    if (searcher.getSize() != 0) {
            if(Log.isDebugEnabled(Geonet.MEF))
                Log.debug(Geonet.MEF, "  Exporting record(s) found for metadata: " + uuid);
View Full Code Here

    context.info("Creating searchers");

    searcher = searchMan.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);

    searcher.search(context, params, _config);

    session.setProperty(Geonet.Session.SEARCH_RESULT, searcher);

    context.info("Getting summary");
   
View Full Code Here

    context.info("Creating searchers");

    if (remotesearcher = searchMan.newSearcher(SearchManager.Z3950,  Geonet.File.SEARCH_Z3950_CLIENT);
    else        searcher = searchMan.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);

    searcher.search(context, elData, _config);
    if (remote && (searcher.getSize() == 0)) { // do it again for Z3950
      searcher.search(context, elData, _config);
    }
    session.setProperty(Geonet.Session.SEARCH_RESULT, searcher);
    session.removeProperty(Geonet.Session.SEARCH_REQUEST);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.