Examples of SearchResult


Examples of org.gephi.datalab.api.SearchReplaceController.SearchResult

            row = searchOptions.getStartingRow();
        }
        if (searchOptions.getStartingColumn() != null) {
            column = searchOptions.getStartingColumn();
        }
        SearchResult result = null;
        if (searchOptions.isSearchNodes()) {
            result = findOnNodes(searchOptions, row, column);
            if (result == null && searchOptions.isLoopToBeginning()) {
                searchOptions.resetStatus();
                return findOnNodes(searchOptions, 0, 0);//If the end of data is reached with no success, try to search again from the beginning as a loop
View Full Code Here

Examples of org.gephi.datalab.api.SearchReplaceController.SearchResult

    public int replaceAll(SearchOptions searchOptions, String replacement) {
        int replacementsCount = 0;
        searchOptions.resetStatus();
        searchOptions.setLoopToBeginning(false);//To avoid infinite loop when the replacement parse makes it to match again.
        SearchResult result;
        result = findNext(searchOptions);
        while (result != null) {
            if (canReplace(result)) {
                result = replace(result, replacement);
                replacementsCount++;
View Full Code Here

Examples of org.gephi.datalab.api.SearchReplaceController.SearchResult

        return replacementsCount;
    }

    private SearchResult findOnNodes(SearchOptions searchOptions, int rowIndex, int columnIndex) {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        SearchResult result = null;
        Set<Integer> columnsToSearch = searchOptions.getColumnsToSearch();
        boolean searchAllColumns = columnsToSearch.isEmpty();
        Node[] nodes = searchOptions.getNodesToSearch();
        AttributeRow row;
        Object value;
        for (; rowIndex < nodes.length; rowIndex++) {
            if (!gec.isNodeInGraph(nodes[rowIndex])) {
                continue;//Make sure node is still in graph when continuing a search
            }
            row = (AttributeRow) nodes[rowIndex].getNodeData().getAttributes();
            for (; columnIndex < row.countValues(); columnIndex++) {
                if (searchAllColumns || columnsToSearch.contains(columnIndex)) {
                    value = row.getValue(columnIndex);
                    result = matchRegex(value, searchOptions, rowIndex, columnIndex);
                    if (result != null) {
                        result.setFoundNode(nodes[rowIndex]);
                        return result;
                    }
                }
                searchOptions.setRegionStart(0);//Start at the beginning for the next value
            }
View Full Code Here

Examples of org.gephi.datalab.api.SearchReplaceController.SearchResult

        return result;
    }

    private SearchResult findOnEdges(SearchOptions searchOptions, int rowIndex, int columnIndex) {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        SearchResult result = null;
        Set<Integer> columnsToSearch = searchOptions.getColumnsToSearch();
        boolean searchAllColumns = columnsToSearch.isEmpty();
        Edge[] edges = searchOptions.getEdgesToSearch();
        AttributeRow row;
        Object value;
        for (; rowIndex < edges.length; rowIndex++) {
            if (!gec.isEdgeInGraph(edges[rowIndex])) {
                continue;//Make sure edge is still in graph when continuing a search
            }
            row = (AttributeRow) edges[rowIndex].getEdgeData().getAttributes();
            for (; columnIndex < row.countValues(); columnIndex++) {
                if (searchAllColumns || columnsToSearch.contains(columnIndex)) {
                    value = row.getValue(columnIndex);
                    result = matchRegex(value, searchOptions, rowIndex, columnIndex);
                    if (result != null) {
                        result.setFoundEdge(edges[rowIndex]);
                        return result;
                    }
                }
                searchOptions.setRegionStart(0);//Start at the beginning for the next value
            }
View Full Code Here

Examples of org.graylog2.indexer.results.SearchResult

        }

        SearchRequest request = searchRequest(config, indexNames).request();

        SearchResponse r = c.search(request).actionGet();
        return new SearchResult(r.getHits(), indices, config.query(), request.source(), r.getTook());
    }
View Full Code Here

Examples of org.graylog2.restclient.models.api.results.SearchResult

            return status(400, views.html.errors.error.render("Invalid range parameters provided.", e2, request()));
        } catch (IllegalArgumentException e1) {
            return status(400, views.html.errors.error.render("Invalid range type provided.", e1, request()));
        }

        SearchResult searchResult;
        DateHistogramResult histogramResult;
        SavedSearch savedSearch;
        Set<String> selectedFields = getSelectedFields(fields);
        String formattedHistogramResults;

        try {
            if (savedSearchId != null && !savedSearchId.isEmpty()) {
                savedSearch = savedSearchService.get(savedSearchId);
            } else {
                savedSearch = null;
            }

            searchResult = search.search();
            if (searchResult.getError() != null) {
                return ok(views.html.search.queryerror.render(currentUser(), q, searchResult, savedSearch, fields, stream));
            }
            searchResult.setAllFields(getAllFields());

            // histogram resolution (strangely aka interval)
            if (interval == null || interval.isEmpty() || !SearchTools.isAllowedDateHistogramInterval(interval)) {
                interval = determineHistogramResolution(searchResult);
            }
            histogramResult = search.dateHistogram(interval);
            formattedHistogramResults = formatHistogramResults(histogramResult.getResults(), displayWidth);
        } catch (IOException e) {
            return status(504, views.html.errors.error.render(ApiClient.ERROR_MSG_IO, e, request()));
        } catch (APIException e) {
            String message = "There was a problem with your search. We expected HTTP 200, but got a HTTP " + e.getHttpCode() + ".";
            return status(504, views.html.errors.error.render(message, e, request()));
        }

        if (searchResult.getTotalResultCount() > 0) {
            return ok(views.html.search.results.render(currentUser(), search, searchResult, histogramResult, formattedHistogramResults, q, page, savedSearch, selectedFields, serverNodes.asMap(), stream));
        } else {
            return ok(views.html.search.noresults.render(currentUser(), q, searchResult, savedSearch, selectedFields, stream));
        }
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.search.SearchResult

                continue;
              }
             
              hashes.add( Base32.encode( hash ));
             
              SearchResult result =
                new SearchResult()
                {
                  public Object
                  getProperty(
                    int    property_name )
                  {
View Full Code Here

Examples of org.jasig.portal.search.SearchResult

            final SearchResults results = new SearchResults();
            results.setQueryId(query.getQueryId());
            results.setWindowId(request.getWindowID());
           
            for (IPersonAttributes person : people) {
                final SearchResult result = new SearchResult();
                result.setTitle((String) person.getAttributeValue("displayName"));
                result.getType().add(directorySearchResultType);
               
                PortletUrl url = new PortletUrl();
                url.setType(PortletUrlType.RENDER);
                url.setPortletMode("VIEW");
                url.setWindowState("maximized");
                PortletUrlParameter actionParam = new PortletUrlParameter();
                actionParam.setName("action");
                actionParam.getValue().add("findByUsername");
                url.getParam().add(actionParam);
                PortletUrlParameter usernameParam = new PortletUrlParameter();
                usernameParam.setName("username");
                usernameParam.getValue().add(person.getName());
                url.getParam().add(usernameParam);
                result.setPortletUrl(url);
                results.getSearchResult().add(result);
            }
           
            // fire a search response event
            response.setEvent(SearchConstants.SEARCH_RESULTS_QNAME, results);
View Full Code Here

Examples of org.jayasoft.woj.common.model.search.SearchResult

      }
      request.setAttribute("start", new Integer(startIndex));
     
      SearchService s = WOJServer.getInstance().getSearchService();

      SearchResult r;
      try {
        r = s.search(q, SecurityHelper.getUAK(request), startIndex);
      } catch (ParseException e) {
        throw new IllegalArgumentException("bad query: "+q);
      }
     
            request.setAttribute("processed", Boolean.TRUE);
            request.setAttribute("query", q);
            request.setAttribute("hitsCount", new Long(r.getHitsCount()));
            request.setAttribute("queryProcessTime", new Long(r.getQueryProcessTime()));
           
            request.setAttribute("nextResults", r.getNextResults());
            request.setAttribute("prevResults", r.getPreviousResults());
           
            request.setAttribute("hits", r.getHits());

            request.setAttribute("processTime", new Long(r.getProcessTime()));
           
            d.forward(request, response);

  }
View Full Code Here

Examples of org.openmeetings.app.data.beans.basic.SearchResult

  public void testAddingGroup(){

    try {
     
       SearchResult users = Usermanagement.getInstance().getAllUserByRange("first", 0, 10, "orderby", true);
       log.debug("[result]" + users.getResult().size());
       log.debug("[records]"+ users.getRecords());
      
       //GroupMemberDaoImpl.getInstance().addGroupMember("Ad", "dir", Calendar.getInstance().getTime(), "1", "2", "interpol155", 1L, 1L); 
      //GroupMemberDaoImpl.getInstance().addGroupMember(firstname, lastname, age, memberStatus, appointmentStatus, password, adresses_id, appointmentId);
     
      //GroupMemberDaoImpl.getInstance().getGroupMemberById(1L);
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.