@Override public void set(CompoundName name,Object value,Map<String,String> context) { super.set(name, value, context == null ? requestMap : context); }
/** * Sets the list of {@link Grouping} objects assigned to the given query. This method overwrites any grouping * objects already assigned to the query. * * @param query The query whose grouping list to set. * @param lst The grouping list to set. */ public static void setGroupingList(Query query, List<Grouping> lst) { query.properties().set(PROP_GROUPINGLIST, lst); }
public void set(CompoundName name, Object value, Map<String,String> context) { if (shouldSet(name, value)) properties.put(name, value); else super.set(name, value, context); }
/** Calls properties.set on all entries in requestMap */ private void setPropertiesFromRequestMap(Map<String, String> requestMap, Properties properties) { for (Map.Entry<String, String> entry : requestMap.entrySet()) { try { properties.set(entry.getKey(), entry.getValue(), requestMap); } catch (IllegalArgumentException e) { throw new QueryException("Invalid request parameter", e); } } }
@Override public void set(CompoundName name,Object value,Map<String,String> context) { super.set(unalias(name),value,context); }
/** Stores this intent model at property key "intentModel" in this query */ public void setTo(Query query) { query.properties().set(intentModelObjectName,this); }
/** Adds parameters specified in the source to the correct namespace in the query */ private void addParameters(Source source,Query query) { for (Map.Entry<String,String> parameter : source.parameters().entrySet()) query.properties().set("source." + source.getName() + "." + parameter.getKey(),parameter.getValue()); }
private void propagatePerSourceQueryProperties(Query original, Query outgoing, Window window, String sourceName, String providerName, List<CompoundName> queryProperties) { for (CompoundName key : queryProperties) { Object value = getSourceOrProviderProperty(original, key, sourceName, providerName, window.get(key)); if (value != null) outgoing.properties().set(key, value); } }
/** * Pass metadata to the next rewriter through query properties * * @param query Query object from the searcher * @param metadata HashMap containing the metadata */ public static void setRewriteMeta(Query query, HashMap<String, Object> metadata) { log(utilsLogger, query, "Passing metadata to the next rewriter"); query.properties().set(RewriterConstants.REWRITE_META, metadata); log(utilsLogger, query, "Successfully passed metadata to the next rewriter"); }
public void produce(RuleEvaluation e,int offset) { e.getEvaluation().getQuery().properties().set(key, value); }
for (Map.Entry<String, Object> entry : originalProperties.listProperties(fullName, context).entrySet()) { try { properties().set(fullName + "." + entry.getKey(), entry.getValue(), context); } catch (IllegalArgumentException e) { throw new QueryException("Invalid request parameter", e); if (value != null) { try { properties().set(fullName, value, context); } catch (IllegalArgumentException e) { throw new QueryException("Invalid request parameter", e);
@Override public Result search(Query query, Execution execution) { Object tensorProperty = query.properties().get("tensor"); if (tensorProperty != null) { // Construct a Tensor object based on the query parameter Tensor tensor = Tensor.from(tensorProperty.toString()); // Create a new rank feature using this tensor query.getRanking().getFeatures().put("query(tensor)", tensor); // Set the rank profile to use query.properties().set(new CompoundName("ranking"), "simple_tensor_ranking"); } return execution.search(query); }
@Override public Result search(Query query, Execution execution) { // Pre execution: Choose template and sources List<PageElement> pages=selectPageTemplates(query); if (pages.isEmpty()) return execution.search(query); // Bypass if no page template chosen addSources(pages,query); // Set the page template list for inspection by other searchers query.properties().set(pagePageTemplateListName, pages); // Execute Result result=execution.search(query); // Post execution: Resolve choices and organize the result as dictated by the resolved template Choice pageTemplateChoice=Choice.createSingletons(pages); Resolution resolution=selectResolver(query).resolve(pageTemplateChoice,query,result); organizer.organize(pageTemplateChoice,resolution,result); return result; }
query.properties().set(streamingLoadtype, metricName);
private Query createFederationQuery(Query query, Query outgoing, Window window, long timeout, Target target) { ComponentId chainId = target.getChain().getId(); String sourceName = chainId.getName(); outgoing.properties().set(SOURCENAME, sourceName); String providerName = chainId.getName(); if (chainId.getNamespace() != null) providerName = chainId.getNamespace().getName(); outgoing.properties().set(PROVIDERNAME, providerName); outgoing.setTimeout(timeout); switch (propagateSourceProperties) { case ALL: propagatePerSourceQueryProperties(query, outgoing, window, sourceName, providerName, Query.nativeProperties); break; case OFFSET_HITS: propagatePerSourceQueryProperties(query, outgoing, window, sourceName, providerName, queryAndHits); break; } //TODO: FederationTarget //TODO: only for target produced by this, not others target.modifyTargetQuery(outgoing); return outgoing; }
public Result search(Query query, Execution execution) { // Get tensor and read items from user profile Object userIdProperty = query.properties().get("user_id"); if (userIdProperty != null) { Hit userProfile = retrieveUserProfile(userIdProperty.toString(), execution); if (userProfile != null) { addUserProfileTensorToQuery(query, userProfile); NotItem notItem = new NotItem(); notItem.addItem(new IntItem(1, "has_user_item_cf")); for (String item : getReadItems(userProfile.getField("has_read_items"))){ notItem.addItem(new WordItem(item, "post_id")); } QueryTreeUtil.andQueryItemWithRoot(query, notItem); } } // Restrict to search in blog_posts query.getModel().setRestrict("blog_post"); // Rank blog posts using tensor rank profile if(query.properties().get("ranking") == null) { query.properties().set(new CompoundName("ranking"), "tensor"); } return execution.search(query); }
query.properties().set(SoftTimeout.enableProperty, false);