Package org.elasticsearch.search.internal

Examples of org.elasticsearch.search.internal.SearchContext.lookup()


            SearchContext context = SearchContext.current();
            if (context == null) {
                throw new ElasticSearchIllegalStateException("No search context on going...");
            }

            this.searchScript = context.scriptService().search(context.lookup(), scriptLang, script, params);
        }

        @Override public String toString() {
            StringBuilder buffer = new StringBuilder();
            buffer.append("ScriptFilter(");
View Full Code Here


        FiltersFunctionScoreQuery.FilterFunction[] filterFunctions = new FiltersFunctionScoreQuery.FilterFunction[filters.size()];
        for (int i = 0; i < filterFunctions.length; i++) {
            ScoreFunction scoreFunction;
            String script = scripts.get(i);
            if (script != null) {
                SearchScript searchScript = context.scriptService().search(context.lookup(), scriptLang, script, vars);
                scoreFunction = new CustomScoreQueryParser.ScriptScoreFunction(searchScript);
            } else {
                scoreFunction = new BoostScoreFunction(boosts.get(i));
            }
            filterFunctions[i] = new FiltersFunctionScoreQuery.FilterFunction(filters.get(i), scoreFunction);
View Full Code Here

        SearchContext context = SearchContext.current();
        if (context == null) {
            throw new ElasticSearchIllegalStateException("No search context on going...");
        }
        SearchScript searchScript = context.scriptService().search(context.lookup(), scriptLang, script, vars);
        FunctionScoreQuery functionScoreQuery = new FunctionScoreQuery(query, new ScriptScoreFunction(searchScript));
        functionScoreQuery.setBoost(boost);
        return functionScoreQuery;
    }
View Full Code Here

    private SearchLookup lookup = null;

    public SearchLookup lookup() {
        SearchContext current = SearchContext.current();
        if (current != null) {
            return current.lookup();
        }
        if (lookup == null) {
            lookup = new SearchLookup(mapperService(), indexQueryParser.fieldDataService, null);
        }
        return lookup;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.