org.elasticsearch.script.ScriptService Java Examples

The following examples show how to use org.elasticsearch.script.ScriptService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CrateSearchContext.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public CrateSearchContext(long id,
                          final long nowInMillis,
                          SearchShardTarget shardTarget,
                          Engine.Searcher engineSearcher,
                          IndexService indexService,
                          final IndexShard indexShard,
                          ScriptService scriptService,
                          PageCacheRecycler pageCacheRecycler,
                          BigArrays bigArrays,
                          Counter timeEstimateCounter,
                          Optional<Scroll> scroll) {
    super(id, new CrateSearchShardRequest(nowInMillis, scroll, indexShard),
            shardTarget, engineSearcher, indexService,
            indexShard, scriptService, pageCacheRecycler,
            bigArrays, timeEstimateCounter, ParseFieldMatcher.STRICT, SearchService.NO_TIMEOUT);
    this.engineSearcher = engineSearcher;
}
 
Example #2
Source File: PercolateContext.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public PercolateContext(PercolateShardRequest request, SearchShardTarget searchShardTarget, IndexShard indexShard,
                        IndexService indexService, PageCacheRecycler pageCacheRecycler,
                        BigArrays bigArrays, ScriptService scriptService, Query aliasFilter, ParseFieldMatcher parseFieldMatcher) {
    super(parseFieldMatcher, request);
    this.indexShard = indexShard;
    this.indexService = indexService;
    this.fieldDataService = indexService.fieldData();
    this.searchShardTarget = searchShardTarget;
    this.percolateQueries = indexShard.percolateRegistry().percolateQueries();
    this.types = new String[]{request.documentType()};
    this.pageCacheRecycler = pageCacheRecycler;
    this.bigArrays = bigArrays.withCircuitBreaking();
    this.querySearchResult = new QuerySearchResult(0, searchShardTarget);
    this.engineSearcher = indexShard.acquireSearcher("percolate");
    this.searcher = new ContextIndexSearcher(engineSearcher, indexService.cache().query(), indexShard.getQueryCachingPolicy());
    this.scriptService = scriptService;
    this.numberOfShards = request.getNumberOfShards();
    this.aliasFilter = aliasFilter;
    this.startTime = request.getStartTime();
}
 
Example #3
Source File: ScriptedMetricAggregator.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
protected ScriptedMetricAggregator(String name, Script initScript, Script mapScript, Script combineScript, Script reduceScript,
        Map<String, Object> params, AggregationContext context, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.params = params;
    ScriptService scriptService = context.searchContext().scriptService();
    if (initScript != null) {
        scriptService.executable(initScript, ScriptContext.Standard.AGGS, context.searchContext(), Collections.<String, String>emptyMap()).run();
    }
    this.mapScript = scriptService.search(context.searchContext().lookup(), mapScript, ScriptContext.Standard.AGGS, Collections.<String, String>emptyMap());
    if (combineScript != null) {
        this.combineScript = scriptService.executable(combineScript, ScriptContext.Standard.AGGS, context.searchContext(), Collections.<String, String>emptyMap());
    } else {
        this.combineScript = null;
    }
    this.reduceScript = reduceScript;
}
 
Example #4
Source File: DefaultSearchContext.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public DefaultSearchContext(long id, ShardSearchRequest request, SearchShardTarget shardTarget,
                            Engine.Searcher engineSearcher, IndexService indexService, IndexShard indexShard,
                            ScriptService scriptService, PageCacheRecycler pageCacheRecycler,
                            BigArrays bigArrays, Counter timeEstimateCounter, ParseFieldMatcher parseFieldMatcher,
                            TimeValue timeout
) {
    super(parseFieldMatcher, request);
    this.id = id;
    this.request = request;
    this.searchType = request.searchType();
    this.shardTarget = shardTarget;
    this.engineSearcher = engineSearcher;
    this.scriptService = scriptService;
    this.pageCacheRecycler = pageCacheRecycler;
    // SearchContexts use a BigArrays that can circuit break
    this.bigArrays = bigArrays.withCircuitBreaking();
    this.dfsResult = new DfsSearchResult(id, shardTarget);
    this.queryResult = new QuerySearchResult(id, shardTarget);
    this.fetchResult = new FetchSearchResult(id, shardTarget);
    this.indexShard = indexShard;
    this.indexService = indexService;
    this.searcher = new ContextIndexSearcher(engineSearcher, indexService.cache().query(), indexShard.getQueryCachingPolicy());
    this.timeEstimateCounter = timeEstimateCounter;
    this.timeoutInMillis = timeout.millis();
}
 
Example #5
Source File: IndexQueryParserService.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public IndexQueryParserService(Index index, IndexSettingsService indexSettingsService,
                               IndicesQueriesRegistry indicesQueriesRegistry,
                               ScriptService scriptService, AnalysisService analysisService,
                               MapperService mapperService, IndexCache indexCache, IndexFieldDataService fieldDataService,
                               BitsetFilterCache bitsetFilterCache,
                               @Nullable SimilarityService similarityService) {
    super(index, indexSettingsService.getSettings());
    this.indexSettingsService = indexSettingsService;
    this.scriptService = scriptService;
    this.analysisService = analysisService;
    this.mapperService = mapperService;
    this.similarityService = similarityService;
    this.indexCache = indexCache;
    this.fieldDataService = fieldDataService;
    this.bitsetFilterCache = bitsetFilterCache;

    Settings indexSettings = indexSettingsService.getSettings();
    this.defaultField = indexSettings.get(DEFAULT_FIELD, AllFieldMapper.NAME);
    this.queryStringLenient = indexSettings.getAsBoolean(QUERY_STRING_LENIENT, false);
    this.parseFieldMatcher = new ParseFieldMatcher(indexSettings);
    this.defaultAllowUnmappedFields = indexSettings.getAsBoolean(ALLOW_UNMAPPED, true);
    this.indicesQueriesRegistry = indicesQueriesRegistry;
}
 
Example #6
Source File: NodeTestConfig.java    From elastic-crud with Apache License 2.0 6 votes vote down vote up
@Bean(destroyMethod="close")
Node newNode() throws NodeValidationException {
  final Path tempDir = createTempDir().toPath();
  final Settings settings = Settings.builder()
    .put(ClusterName.CLUSTER_NAME_SETTING.getKey(), new ClusterName("single-node-cluster" + System.nanoTime()))
    .put(Environment.PATH_HOME_SETTING.getKey(), tempDir)
    .put(Environment.PATH_REPO_SETTING.getKey(), tempDir.resolve("repo"))
    .put(Environment.PATH_SHARED_DATA_SETTING.getKey(), createTempDir().getParent())
    .put("node.name", "single-node")
    .put("script.inline", "true")
    .put("script.stored", "true")
    .put(ScriptService.SCRIPT_MAX_COMPILATIONS_PER_MINUTE.getKey(), 1000)
    .put(EsExecutors.PROCESSORS_SETTING.getKey(), 1)
    .put(NetworkModule.HTTP_ENABLED.getKey(), false)
    .put("discovery.type", "zen")
    .put("transport.type", "local")
    .put(Node.NODE_DATA_SETTING.getKey(), true)
    .put(NODE_ID_SEED_SETTING.getKey(), System.nanoTime())
    .build();
  return new Node(settings).start(); // NOSONAR
}
 
Example #7
Source File: LtrQueryParserPlugin.java    From elasticsearch-learning-to-rank with Apache License 2.0 6 votes vote down vote up
@Override
public Collection<Object> createComponents(Client client,
                                           ClusterService clusterService,
                                           ThreadPool threadPool,
                                           ResourceWatcherService resourceWatcherService,
                                           ScriptService scriptService,
                                           NamedXContentRegistry xContentRegistry,
                                           Environment environment,
                                           NodeEnvironment nodeEnvironment,
                                           NamedWriteableRegistry namedWriteableRegistry,
                                           IndexNameExpressionResolver indexNameExpressionResolver) {
    clusterService.addListener(event -> {
        for (Index i : event.indicesDeleted()) {
            if (IndexFeatureStore.isIndexStore(i.getName())) {
                caches.evict(i.getName());
            }
        }
    });
    return asList(caches, parserFactory);
}
 
Example #8
Source File: TransportTermsByQueryAction.java    From siren-join with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Constructor
 */
@Inject
public TransportTermsByQueryAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                   TransportService transportService, IndicesService indicesService,
                                   CircuitBreakerService breakerService,
                                   ScriptService scriptService, PageCacheRecycler pageCacheRecycler,
                                   BigArrays bigArrays, ActionFilters actionFilters,
                                   IndexNameExpressionResolver indexNameExpressionResolver, Client client) {
  super(settings, TermsByQueryAction.NAME, threadPool, clusterService, transportService, actionFilters,
          indexNameExpressionResolver, TermsByQueryRequest.class, TermsByQueryShardRequest.class,
          // Use the generic threadpool which is cached, as we can end up with deadlock with the SEARCH threadpool
          ThreadPool.Names.GENERIC);
  this.indicesService = indicesService;
  this.scriptService = scriptService;
  this.pageCacheRecycler = pageCacheRecycler;
  this.bigArrays = bigArrays;
  this.breakerService = breakerService;
  this.client = client;
}
 
Example #9
Source File: DynamicRanker.java    From elasticsearch-dynarank with Apache License 2.0 6 votes vote down vote up
@Inject
public DynamicRanker(final Settings settings, final Client client, final ClusterService clusterService,
        final ScriptService scriptService, final ThreadPool threadPool, final ActionFilters filters,
        final NamedWriteableRegistry namedWriteableRegistry) {
    this.client = client;
    this.clusterService = clusterService;
    this.scriptService = scriptService;
    this.threadPool = threadPool;
    this.namedWriteableRegistry = namedWriteableRegistry;

    logger.info("Initializing DynamicRanker");

    final TimeValue expire = SETTING_DYNARANK_CACHE_EXPIRE.get(settings);
    cleanInterval = SETTING_DYNARANK_CACHE_CLEAN_INTERVAL.get(settings);

    final CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder().concurrencyLevel(16);
    if (expire.millis() >= 0) {
        builder.expireAfterAccess(expire.millis(), TimeUnit.MILLISECONDS);
    }
    scriptInfoCache = builder.build();
}
 
Example #10
Source File: AbstractTransportExportAction.java    From elasticsearch-inout-plugin with Apache License 2.0 6 votes vote down vote up
public AbstractTransportExportAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                     TransportService transportService, IndicesService indicesService,
                                     ScriptService scriptService, CacheRecycler cacheRecycler,
                                     IExportParser exportParser, Exporter exporter,
                                     NodeEnvironment nodeEnv) {
    super(settings, threadPool, clusterService, transportService);
    this.indicesService = indicesService;
    this.scriptService = scriptService;
    this.cacheRecycler = cacheRecycler;
    this.exportParser = exportParser;
    this.exporter = exporter;
    File[] paths = nodeEnv.nodeDataLocations();
    if (paths.length > 0) {
        nodePath = paths[0].getAbsolutePath();
    }
}
 
Example #11
Source File: OpenDistroSecuritySSLPlugin.java    From deprecated-security-ssl with Apache License 2.0 5 votes vote down vote up
@Override
public Collection<Object> createComponents(Client localClient, ClusterService clusterService, ThreadPool threadPool,
        ResourceWatcherService resourceWatcherService, ScriptService scriptService, NamedXContentRegistry xContentRegistry,
        Environment environment, NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {

    final List<Object> components = new ArrayList<>(1);
    
    if(client) {
        return components;
    }
    
    final String principalExtractorClass = settings.get(SSLConfigConstants.OPENDISTRO_SECURITY_SSL_TRANSPORT_PRINCIPAL_EXTRACTOR_CLASS, null);

    if(principalExtractorClass == null) {
        principalExtractor = new com.amazon.opendistroforelasticsearch.security.ssl.transport.DefaultPrincipalExtractor();
    } else {
        try {
            log.debug("Try to load and instantiate '{}'", principalExtractorClass);
            Class<?> principalExtractorClazz = Class.forName(principalExtractorClass);
            principalExtractor = (PrincipalExtractor) principalExtractorClazz.newInstance();
        } catch (Exception e) {
            log.error("Unable to load '{}' due to", principalExtractorClass, e);
            throw new ElasticsearchException(e);
        }
    }
    
    components.add(principalExtractor);
    
    return components;
}
 
Example #12
Source File: InternalCountOperation.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public InternalCountOperation(ScriptService scriptService, // DO NOT REMOVE, RESULTS IN WEIRD GUICE DI ERRORS
                              LuceneQueryBuilder queryBuilder,
                              ThreadPool threadPool,
                              IndicesService indicesService) {
    this.queryBuilder = queryBuilder;
    this.threadPool = threadPool;
    this.indicesService = indicesService;
}
 
Example #13
Source File: SearchContextFactory.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public SearchContextFactory(LuceneQueryBuilder luceneQueryBuilder,
                            ClusterService clusterService,
                            ScriptService scriptService,
                            PageCacheRecycler pageCacheRecycler,
                            BigArrays bigArrays,
                            ThreadPool threadPool) {
    this.luceneQueryBuilder = luceneQueryBuilder;
    this.clusterService = clusterService;
    this.scriptService = scriptService;
    this.pageCacheRecycler = pageCacheRecycler;
    this.bigArrays = bigArrays;
    this.threadPool = threadPool;
}
 
Example #14
Source File: PercolatorService.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public PercolatorService(Settings settings, IndexNameExpressionResolver indexNameExpressionResolver, IndicesService indicesService,
                         PageCacheRecycler pageCacheRecycler, BigArrays bigArrays,
                         HighlightPhase highlightPhase, ClusterService clusterService,
                         AggregationPhase aggregationPhase, ScriptService scriptService,
                         MappingUpdatedAction mappingUpdatedAction) {
    super(settings);
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    this.parseFieldMatcher = new ParseFieldMatcher(settings);
    this.indicesService = indicesService;
    this.pageCacheRecycler = pageCacheRecycler;
    this.bigArrays = bigArrays;
    this.clusterService = clusterService;
    this.highlightPhase = highlightPhase;
    this.aggregationPhase = aggregationPhase;
    this.scriptService = scriptService;
    this.mappingUpdatedAction = mappingUpdatedAction;
    this.sortParseElement = new SortParseElement();

    final long maxReuseBytes = settings.getAsBytesSize("indices.memory.memory_index.size_per_thread", new ByteSizeValue(1, ByteSizeUnit.MB)).bytes();
    cache = new CloseableThreadLocal<MemoryIndex>() {
        @Override
        protected MemoryIndex initialValue() {
            // TODO: should we expose payloads as an option? should offsets be turned on always?
            return new ExtendedMemoryIndex(true, false, maxReuseBytes);
        }
    };
    single = new SingleDocumentPercolatorIndex(cache);
    multi = new MultiDocumentPercolatorIndex(cache);

    percolatorTypes = new IntObjectHashMap<>(6);
    percolatorTypes.put(countPercolator.id(), countPercolator);
    percolatorTypes.put(queryCountPercolator.id(), queryCountPercolator);
    percolatorTypes.put(matchPercolator.id(), matchPercolator);
    percolatorTypes.put(queryPercolator.id(), queryPercolator);
    percolatorTypes.put(scoringPercolator.id(), scoringPercolator);
    percolatorTypes.put(topMatchingPercolator.id(), topMatchingPercolator);
}
 
Example #15
Source File: SignificanceHeuristicParserMapper.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public SignificanceHeuristicParserMapper(Set<SignificanceHeuristicParser> parsers, ScriptService scriptService) {
    Map<String, SignificanceHeuristicParser> map = new HashMap<>();
    add(map, new JLHScore.JLHScoreParser());
    add(map, new PercentageScore.PercentageScoreParser());
    add(map, new MutualInformation.MutualInformationParser());
    add(map, new ChiSquare.ChiSquareParser());
    add(map, new GND.GNDParser());
    add(map, new ScriptHeuristic.ScriptHeuristicParser(scriptService));
    for (SignificanceHeuristicParser parser : parsers) {
        add(map, parser);
    }
    significanceHeuristicParsers = Collections.unmodifiableMap(map);
}
 
Example #16
Source File: SearchPhaseController.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public SearchPhaseController(Settings settings, BigArrays bigArrays, ScriptService scriptService) {
    super(settings);
    this.bigArrays = bigArrays;
    this.scriptService = scriptService;
    this.optimizeSingleShard = settings.getAsBoolean(SEARCH_CONTROLLER_OPTIMIZE_SINGLE_SHARD_KEY, true);
}
 
Example #17
Source File: Suggesters.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
private static Map<String, Suggester> addBuildIns(Map<String, Suggester> suggesters, ScriptService scriptService) {
    final Map<String, Suggester> map = new HashMap<>();
    map.put("phrase", new PhraseSuggester(scriptService));
    map.put("term", new TermSuggester());
    map.put("completion", new CompletionSuggester());
    map.putAll(suggesters);
    return map;
}
 
Example #18
Source File: TemplateQueryParser.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public static Template parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher, String... parameters) throws IOException {

        Map<String, ScriptService.ScriptType> parameterMap = new HashMap<>(parametersToTypes);
        for (String parameter : parameters) {
            parameterMap.put(parameter, ScriptService.ScriptType.INLINE);
        }
        return parse(parser, parameterMap, parseFieldMatcher);
    }
 
Example #19
Source File: TemplateQueryParser.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public static Template parse(String defaultLang, XContentParser parser, ParseFieldMatcher parseFieldMatcher, String... parameters) throws IOException {

        Map<String, ScriptService.ScriptType> parameterMap = new HashMap<>(parametersToTypes);
        for (String parameter : parameters) {
            parameterMap.put(parameter, ScriptService.ScriptType.INLINE);
        }
        return Template.parse(parser, parameterMap, defaultLang, parseFieldMatcher);
    }
 
Example #20
Source File: DocumentMapperParser.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public DocumentMapperParser(Settings indexSettings, MapperService mapperService, AnalysisService analysisService,
                            SimilarityLookupService similarityLookupService, ScriptService scriptService,
                            MapperRegistry mapperRegistry,
                            @Nullable DynamicArrayFieldMapperBuilderFactory dynamicArrayFieldMapperBuilderFactory) {
    this.dynamicArrayFieldMapperBuilderFactory = dynamicArrayFieldMapperBuilderFactory;
    this.parseFieldMatcher = new ParseFieldMatcher(indexSettings);
    this.scriptService = scriptService;
    this.mapperService = mapperService;
    this.analysisService = analysisService;
    this.similarityLookupService = similarityLookupService;
    this.typeParsers = mapperRegistry.getMapperParsers();
    this.rootTypeParsers = mapperRegistry.getMetadataMapperParsers();
    indexVersionCreated = Version.indexCreated(indexSettings);
}
 
Example #21
Source File: MapperService.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public MapperService(Index index, Settings indexSettings, AnalysisService analysisService,
                     SimilarityLookupService similarityLookupService,
                     ScriptService scriptService, MapperRegistry mapperRegistry,
                     DynamicArrayFieldMapperBuilderFactoryProvider dynamicArrayFieldMapperBuilderFactoryProvider) {
    this(index, new IndexSettingsService(index, indexSettings), analysisService, similarityLookupService, scriptService,
        mapperRegistry, dynamicArrayFieldMapperBuilderFactoryProvider);
}
 
Example #22
Source File: DocumentMapper.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
/**
 * @deprecated Use {@link #transform(ScriptService, Script)} instead.
 */
@Deprecated
public Builder transform(ScriptService scriptService, String script, ScriptType scriptType, String language,
        Map<String, Object> parameters) {
    sourceTransforms.add(new ScriptTransform(scriptService, new Script(script, scriptType, language, parameters)));
    return this;
}
 
Example #23
Source File: MetaDataIndexUpgradeService.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public MetaDataIndexUpgradeService(Settings settings, ScriptService scriptService, MapperRegistry mapperRegistry,
                                   DynamicArrayFieldMapperBuilderFactoryProvider dynamicArrayFieldMapperBuilderFactoryProvider) {
    super(settings);
    this.scriptService = scriptService;
    this.mapperRegistry = mapperRegistry;
    this.dynamicArrayFieldMapperBuilderFactoryProvider = dynamicArrayFieldMapperBuilderFactoryProvider;
    final String pre20HashFunctionName = settings.get(DEPRECATED_SETTING_ROUTING_HASH_FUNCTION, null);
    final boolean hasCustomPre20HashFunction = pre20HashFunctionName != null;
    // the hash function package has changed we replace the two hash functions if their fully qualified name is used.
    if (hasCustomPre20HashFunction) {
        switch (pre20HashFunctionName) {
            case "Simple":
            case "simple":
            case "org.elasticsearch.cluster.routing.operation.hash.simple.SimpleHashFunction":
                pre20HashFunction = SimpleHashFunction.class;
                break;
            case "Djb":
            case "djb":
            case "org.elasticsearch.cluster.routing.operation.hash.djb.DjbHashFunction":
                pre20HashFunction = DjbHashFunction.class;
                break;
            default:
                try {
                    pre20HashFunction = Class.forName(pre20HashFunctionName).asSubclass(HashFunction.class);
                } catch (ClassNotFoundException|NoClassDefFoundError e) {
                    throw new ElasticsearchException("failed to load custom hash function [" + pre20HashFunctionName + "]", e);
                }
        }
    } else {
        pre20HashFunction = DjbHashFunction.class;
    }
    pre20UseType = settings.getAsBoolean(DEPRECATED_SETTING_ROUTING_USE_TYPE, null);
    if (hasCustomPre20HashFunction || pre20UseType != null) {
        logger.warn("Settings [{}] and [{}] are deprecated. Index settings from your old indices have been updated to record the fact that they "
                + "used some custom routing logic, you can now remove these settings from your `elasticsearch.yml` file", DEPRECATED_SETTING_ROUTING_HASH_FUNCTION, DEPRECATED_SETTING_ROUTING_USE_TYPE);
    }
}
 
Example #24
Source File: TransportExistsAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportExistsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
                            IndicesService indicesService, ScriptService scriptService,
                            PageCacheRecycler pageCacheRecycler, BigArrays bigArrays, ActionFilters actionFilters,
                             IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ExistsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            ExistsRequest.class, ShardExistsRequest.class, ThreadPool.Names.SEARCH);
    this.indicesService = indicesService;
    this.scriptService = scriptService;
    this.pageCacheRecycler = pageCacheRecycler;
    this.bigArrays = bigArrays;
}
 
Example #25
Source File: TransportValidateQueryAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportValidateQueryAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                    TransportService transportService, IndicesService indicesService,
                                    ScriptService scriptService, PageCacheRecycler pageCacheRecycler,
                                    BigArrays bigArrays, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ValidateQueryAction.NAME, threadPool, clusterService, transportService, actionFilters,
            indexNameExpressionResolver, ValidateQueryRequest.class, ShardValidateQueryRequest.class, ThreadPool.Names.SEARCH);
    this.indicesService = indicesService;
    this.scriptService = scriptService;
    this.pageCacheRecycler = pageCacheRecycler;
    this.bigArrays = bigArrays;
}
 
Example #26
Source File: TransportExplainAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportExplainAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                              TransportService transportService, IndicesService indicesService,
                              ScriptService scriptService, PageCacheRecycler pageCacheRecycler,
                              BigArrays bigArrays, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ExplainAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            ExplainRequest.class, ThreadPool.Names.GET);
    this.indicesService = indicesService;
    this.scriptService = scriptService;
    this.pageCacheRecycler = pageCacheRecycler;
    this.bigArrays = bigArrays;
}
 
Example #27
Source File: TransportPutIndexedScriptAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportPutIndexedScriptAction(Settings settings, ThreadPool threadPool, ScriptService scriptService,
                                       TransportService transportService, ActionFilters actionFilters,
                                       IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, PutIndexedScriptAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, PutIndexedScriptRequest.class);
    this.scriptService = scriptService;
}
 
Example #28
Source File: PutIndexedScriptRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    String sSource = "_na_";
    try {
        sSource = XContentHelper.convertToJson(source, false);
    } catch (Exception e) {
        // ignore
    }
    return "index {[" + ScriptService.SCRIPT_INDEX + "][" + scriptLang + "][" + id + "], source[" + sSource + "]}";
}
 
Example #29
Source File: PutIndexedScriptResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public PutIndexedScriptResponse(String type, String id, long version, boolean created) {
    this.index = ScriptService.SCRIPT_INDEX;
    this.id = id;
    this.scriptLang = type;
    this.version = version;
    this.created = created;
}
 
Example #30
Source File: PutIndexedScriptResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    index = ScriptService.SCRIPT_INDEX;
    scriptLang = in.readString();
    id = in.readString();
    version = in.readLong();
    created = in.readBoolean();
}