<p>
Traverses the API and searches for all products matching the query term.
</p>

@param query some query term
@param embeddedProducts query for embedded products
@see <a href="https://github.com/damnhandy/Handy-URI-Templates">Handy-URI-Templates</a>
184419
public void traverse(final String query, final boolean embeddedProducts) throws IOException {
        System.out.println("\n\n");
        System.out.println("---------- Traverson Example ----------");
        traverson(this::getHalJson)
                .startWith(HOME_URI)
                .follow(REL_SEARCH, withVars("q", query, "embedded", embeddedProducts))
                .follow(REL_PRODUCT)
                .streamAs(BookHalJson.class)
                .forEach(product->{
                    System.out.println("|   * " + product.title + ": " + format("%.2f€", product.retailPrice/100.0));
                });
        System.out.println("----------------------------------------");
    }
651335
public Map<String, List<String>> parseQuery(String query)
    {
        Map<String, List<String>> queryParams = new LinkedHashMap<>();
        if (query != null) {
            for (NameValuePair params : URLEncodedUtils.parse(query, StandardCharsets.UTF_8)) {
                String name = params.getName();
                List<String> values = queryParams.get(name);
                if (values == null) {
                    values = new ArrayList<>();
                    queryParams.put(name, values);
                }
                values.add(params.getValue());
            }
        }
        return queryParams;
    }
300979
@Override
	public ConstrainedResultSet<ID> findIdsByUriQuery(final WebQuery query)
	{
		return (ConstrainedResultSet<ID>) find(query, JPASearchStrategy.ID);
	}
1192097
@SafeVarargs
    public final boolean exists(final String query, final Object... parameters) {
        final QueryResult resultSet = execute(query, parameters);

        return resultSet.iterator().hasNext();
    }
745780
public void setQuery(String query) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(query)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_VALIDATE_SEARCH_QUERY_0));
        }
        m_query = query;
    }
1186554
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commerceNotificationTemplatePersistence.findWithDynamicQuery(dynamicQuery);
	}
319757
public @Nonnull Iterable<VirtualMachineProduct> listProducts( @Nonnull VirtualMachineProductFilterOptions options, @Nullable Architecture architecture ) throws InternalException, CloudException {
        String cacheName = "ALL";
        if( architecture != null ) {
            cacheName = architecture.name();
        }
        Cache<VirtualMachineProduct> cache = Cache.getInstance(getProvider(), "products" + cacheName, VirtualMachineProduct.class, CacheLevel.REGION, new TimePeriod<Day>(1, TimePeriod.DAY));
        Iterable<VirtualMachineProduct> products = cache.get(getContext());
        if( products != null && products.iterator().hasNext() ) {
            return products;
        }

        List<VirtualMachineProduct> list = new ArrayList<VirtualMachineProduct>();
        //Perform DigitalOcean query
        Sizes availableSizes = (Sizes)DigitalOceanModelFactory.getModel(getProvider(), org.dasein.cloud.digitalocean.models.rest.DigitalOcean.SIZES);

        if (availableSizes != null) {
            for( Size s : availableSizes.getSizes() ) {
                VirtualMachineProduct product = toProduct(s);
                if( product != null ) {
                    list.add(product);
                }
            }
            cache.put(getContext(), list);
        }
        else {
            logger.error("No product could be found, " + getProvider().getCloudName() + " provided no data for their sizes API.");
            throw new CloudException("No product could be found.");
        }
        return list;
    }
301271
public static void applyOrderBy(MultivaluedMap<String, String> queryParams, Query query) {
        List<String> orders = queryParams.get(SORT_PARAM_NAME);
        if (orders != null && orders.size() > 0) {
            OrderBy orderBy = query.orderBy();
            for (String order : orders) {
                EbeanUtils.appendOrder(orderBy, order);
            }
        }
    }
592017
def search(self, query, _options={}, products=None):
        '''
        
        '''
        options = _options or {}

        return self.client.post_public_key('/institutions/search', {
            'query': query,
            'products': products,
            'options': options,
        })
759827
public void doSuggestOpenSearch(StaplerRequest req, StaplerResponse rsp, @QueryParameter String q) throws IOException, ServletException {
        rsp.setContentType(Flavor.JSON.contentType);
        DataWriter w = Flavor.JSON.createDataWriter(null, rsp);
        w.startArray();
        w.value(q);

        w.startArray();
        for (SuggestedItem item : getSuggestions(req, q))
            w.value(item.getPath());
        w.endArray();
        w.endArray();
    }
982398
public URIBuilder setQuery(final String query) {
		 this.queryParams = parseQuery(query, Consts.UTF_8);
		 this.encodedQuery = null;
		 this.encodedSchemeSpecificPart = null;
		 return this;
	 }
905491
@Override
    public final Query createQuery(String query)
    {
        checkClosed();
        checkTransactionNeeded();
        return getPersistenceDelegator().createQuery(query);
    }
1232411
private static String initFindEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) {
		StringBuilder queryBuilder = new StringBuilder( "MATCH " );
		queryBuilder.append( "(" );
		queryBuilder.append( ENTITY_ALIAS );
		queryBuilder.append( ":" );
		queryBuilder.append( ENTITY );
		queryBuilder.append( ":" );
		appendLabel( entityKeyMetadata, queryBuilder );
		queryBuilder.append( ")" );
		appendOptionalMatchOwnerEmbeddedNodes( queryBuilder );
		appendGetEmbeddedNodesIfNeeded( includeEmbedded, queryBuilder );
		return queryBuilder.toString();
	}
972881
public static QueryFactory getQueryFactory(Cache<?, ?> cache) {
      if (cache == null || cache.getAdvancedCache() == null) {
         throw new IllegalArgumentException("cache parameter shall not be null");
      }
      AdvancedCache<?, ?> advancedCache = cache.getAdvancedCache();
      ensureAccessPermissions(advancedCache);
      EmbeddedQueryEngine queryEngine = SecurityActions.getCacheComponentRegistry(advancedCache).getComponent(EmbeddedQueryEngine.class);
      if (queryEngine == null) {
         throw log.queryModuleNotInitialised();
      }
      return new EmbeddedQueryFactory(queryEngine);
   }
718285
public void search(
        Map<String, List<String>> fieldFacets,
        Map<String, List<String>> rangeFacets,
        String additionalQuery) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly((String)m_resultSorter.getValue())) {
            m_currentConfigParser.setSortOption((String)m_resultSorter.getValue());
        }

        CmsSolrQuery query = m_currentConfigParser.getInitialQuery();
        CmsSearchController controller = new CmsSearchController(new CmsSearchConfiguration(m_currentConfigParser));
        controller.getPagination().getState().setCurrentPage(1);
        if (fieldFacets != null) {
            Map<String, I_CmsSearchControllerFacetField> fieldFacetControllers = controller.getFieldFacets().getFieldFacetController();
            for (Map.Entry<String, List<String>> facetEntry : fieldFacets.entrySet()) {
                I_CmsSearchStateFacet state = fieldFacetControllers.get(facetEntry.getKey()).getState();
                state.clearChecked();
                for (String check : facetEntry.getValue()) {
                    state.addChecked(check);
                }
            }
        }
        if (rangeFacets != null) {
            Map<String, I_CmsSearchControllerFacetRange> rangeFacetControllers = controller.getRangeFacets().getRangeFacetController();
            for (Map.Entry<String, List<String>> facetEntry : rangeFacets.entrySet()) {
                I_CmsSearchStateFacet state = rangeFacetControllers.get(facetEntry.getKey()).getState();
                state.clearChecked();
                for (String check : facetEntry.getValue()) {
                    state.addChecked(check);
                }
            }
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(additionalQuery)) {
            controller.getCommon().getState().setQuery(additionalQuery);
        } else {
            resetTextSearch();
        }

        controller.addQueryParts(query, A_CmsUI.getCmsObject());
        executeSearch(controller, query);
    }
151036
public function scopeByProduct($query, Buyable $product)
    {
        return $query->where([
            ['product_id', '=', $product->getId()],
            ['product_type', '=', $product->morphTypeName()]
        ]);
    }
782969
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commerceWarehouseItemPersistence.findWithDynamicQuery(dynamicQuery);
	}