class SearchFilter implements ComplexFilter {

        private String query;
        private String type;

        public SearchFilter() {
            type = SearchCategoryImpl.NODES().getId();
        }

        @Override
        public Graph filter(Graph graph) {<FILL_FUNCTION_BODY>}

        public String getName() {
            return NbBundle.getMessage(SearchFilterBuilder.class, "SearchFilter.name");
        }

        public FilterProperty[] getProperties() {
            try {
                return new FilterProperty[] {
                    FilterProperty.createProperty(this, String.class, "query"),
                    FilterProperty.createProperty(this, String.class, "type")};
            } catch (NoSuchMethodException ex) {
                Exceptions.printStackTrace(ex);
            }
            return new FilterProperty[0];
        }

        public String getQuery() {
            return query;
        }

        public void setQuery(String query) {
            this.query = query;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }
    }

            if (query == null || query.isEmpty()) {
                return graph;
            }
            SearchRequest request =
                SearchRequest.builder().query(query).graph(graph).parallel(false).limitResults(false).build();
            SearchController searchController = Lookup.getDefault().lookup(SearchController.class);
            Subgraph subgraph = graph.getModel().getGraph(graph.getView());
            if (type.equalsIgnoreCase(SearchCategoryImpl.NODES().getId())) {
                List<Node> nodes = searchController.search(request, Node.class).stream()
                    .map(SearchResult::getResult).collect(Collectors.toList());
                subgraph.retainNodes(nodes);
            } else if (type.equalsIgnoreCase(SearchCategoryImpl.EDGES().getId())) {
                List<Edge> edges = searchController.search(request, Edge.class).stream()
                    .map(SearchResult::getResult).collect(Collectors.toList());
                subgraph.retainEdges(edges);
            }
            return subgraph;
        
<no_super_class>