public LeafSearchLookup getLeafSearchLookup(LeafReaderContext context) { return new LeafSearchLookup(context, docMap.getLeafDocLookup(context), sourceLookup, fieldsLookup.getLeafFieldsLookup(context)); }
public void setDocument(int docId) { docMap.setDocument(docId); sourceLookup.setSegmentAndDocument(ctx, docId); fieldsLookup.setDocument(docId); } }
public void setDocument(int docId) { if (this.docId == docId) { // if we are called with the same docId, don't invalidate source return; } this.docId = docId; clearCache(); }
public SearchLookup(MapperService mapperService, Function<MappedFieldType, IndexFieldData<?>> fieldDataLookup, @Nullable String[] types) { docMap = new DocLookup(mapperService, fieldDataLookup, types); sourceLookup = new SourceLookup(); fieldsLookup = new FieldsLookup(mapperService, types); }
/** Set the current document to run the script on next. */ public void setDocument(int docid) { // TODO: remove leniency when painless does not implement SearchScript for executable script cases if (leafLookup != null) { leafLookup.setDocument(docid); } }
/** * The source of the document (As a map). */ @SuppressWarnings({"unchecked"}) public Map<String, Object> sourceAsMap() throws ElasticsearchParseException { if (source == null) { return null; } if (sourceAsMap != null) { return sourceAsMap; } sourceAsMap = SourceLookup.sourceAsMap(source); return sourceAsMap; }
/** * The doc lookup for the Lucene segment this script was created for. */ public Map<String, ScriptDocValues<?>> getDoc() { return leafLookup.doc(); }
public FilterScript(Map<String, Object> params, SearchLookup lookup, LeafReaderContext leafContext) { this.params = params; this.leafLookup = lookup.getLeafSearchLookup(leafContext); }
public LeafDocLookup getLeafDocLookup(LeafReaderContext context) { return new LeafDocLookup(mapperService, fieldDataLookup, types, context); }
@Override public boolean containsKey(Object key) { try { loadFieldData(key.toString()); return true; } catch (Exception e) { return false; } }
/** * Set the current document to run the script on next. */ public void setDocument(int docid) { leafLookup.setDocument(docid); }
/** * The source of the document as a map (can be {@code null}). */ public Map<String, Object> getSourceAsMap() { if (source == null) { return null; } if (sourceAsMap != null) { return sourceAsMap; } sourceAsMap = SourceLookup.sourceAsMap(source); return sourceAsMap; }
/** The doc lookup for the Lucene segment this script was created for. */ public final LeafDocLookup getDoc() { // TODO: remove leniency when painless does not implement SearchScript for executable script cases return leafLookup == null ? null : leafLookup.doc(); }
public SearchScript(Map<String, Object> params, SearchLookup lookup, LeafReaderContext leafContext) { this.params = params; // TODO: remove leniency when painless does not implement SearchScript for executable script cases this.leafLookup = leafContext == null ? null : lookup.getLeafSearchLookup(leafContext); }
public void setDocument(int docId) { if (leafLookup != null) { leafLookup.setDocument(docId); } }
public Map<String, ScriptDocValues<?>> getDoc() { return leafLookup == null ? null : leafLookup.doc(); }
/** Set the current document to run the script on next. */ public void setDocument(int docid) { leafLookup.setDocument(docid); }
/** The doc lookup for the Lucene segment this script was created for. */ public final Map<String, ScriptDocValues<?>> getDoc() { return leafLookup.doc(); }
/** Set the current document to run the script on next. */ public void setDocument(int docid) { leafLookup.setDocument(docid); }
/** The doc lookup for the Lucene segment this script was created for. */ public final Map<String, ScriptDocValues<?>> getDoc() { return leafLookup.doc(); }