Examples of BoostScoreFunction


Examples of org.elasticsearch.common.lucene.search.function.BoostScoreFunction

            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);
        }
        FiltersFunctionScoreQuery functionScoreQuery = new FiltersFunctionScoreQuery(query, scoreMode, filterFunctions);
        functionScoreQuery.setBoost(boost);
View Full Code Here

Examples of org.elasticsearch.common.lucene.search.function.BoostScoreFunction

            }
        }
        if (query == null) {
            throw new QueryParsingException(parseContext.index(), "[constant_factor_query] requires 'query' element");
        }
        FunctionScoreQuery functionScoreQuery = new FunctionScoreQuery(query, new BoostScoreFunction(boostFactor));
        functionScoreQuery.setBoost(boost);
        return functionScoreQuery;
    }
View Full Code Here

Examples of org.elasticsearch.common.lucene.search.function.BoostScoreFunction

    @Override public void preProcess(SearchContext context) {
        if (context.query() == null) {
            context.parsedQuery(ParsedQuery.MATCH_ALL_PARSED_QUERY);
        }
        if (context.queryBoost() != 1.0f) {
            context.parsedQuery(new ParsedQuery(new FunctionScoreQuery(context.query(), new BoostScoreFunction(context.queryBoost())), context.parsedQuery()));
        }
        facetPhase.preProcess(context);
    }
View Full Code Here

Examples of org.elasticsearch.common.lucene.search.function.BoostScoreFunction

    }

    @Override
    public ScoreFunction parse(QueryParseContext parseContext, XContentParser parser) throws IOException, QueryParsingException {
        float boostFactor = parser.floatValue();
        return new BoostScoreFunction(boostFactor);
    }
View Full Code Here

Examples of org.elasticsearch.common.lucene.search.function.BoostScoreFunction

        if (query() == null) {
            parsedQuery(ParsedQuery.parsedMatchAllQuery());
        }
        if (queryBoost() != 1.0f) {
            parsedQuery(new ParsedQuery(new FunctionScoreQuery(query(), new BoostScoreFunction(queryBoost)), parsedQuery()));
        }
        Filter searchFilter = searchFilter(types());
        if (searchFilter != null) {
            if (Queries.isConstantMatchAllQuery(query())) {
                Query q = new ConstantScoreQuery(searchFilter);
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.