public class ScoreJoinQParserPlugin extends QParserPlugin
JoinUtil.createJoinQuery(String, boolean, String, Query, org.apache.lucene.search.IndexSearcher, ScoreMode)
.
It runs subordinate query and collects values of "from" field and scores, then it lookups these collected values in "to" field, and
yields aggregated scores.
Local parameters are similar to JoinQParserPlugin
{!join}
This plugin doesn't have own name, and is called by specifying local parameter {!join score=...}...
.
Note: this parser is invoked even if you specify score=none
.
q={!join from=manu_id_s to=id score=total}foo
foo
in example above).
it's better to have this field declared as type="string" docValues="true"
.
note: if docValues are not enabled for this field, it will work anyway,
but it costs some memory for UninvertingReader
.
Also, numeric doc values are not supported until LUCENE-5868.
Thus, it only supports DocValuesType.SORTED
, DocValuesType.SORTED_SET
, DocValuesType.BINARY
. from
values are collected) rather than current core.
q={!join from=manu_id_s to=id score=total fromIndex=products}foo
indexed="true"
. Now it's treated as a single value field.ScoreMode
: none,avg,total,max,min
. Capital case is also accepted.SolrInfoBean.Category, SolrInfoBean.Group
Modifier and Type | Field and Description |
---|---|
static String |
SCORE |
DEFAULT_QTYPE, standardPlugins
Constructor and Description |
---|
ScoreJoinQParserPlugin() |
Modifier and Type | Method and Description |
---|---|
QParser |
createParser(String qstr,
SolrParams localParams,
SolrParams params,
SolrQueryRequest req)
return a
QParser |
static String |
getCoreName(String fromIndex,
CoreContainer container)
Returns an String with the name of a core.
|
getCategory, getDescription, getMetricNames, getName, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricRegistry, getMetricsSnapshot, registerMetricName
public static final String SCORE
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req)
QParserPlugin
QParser
createParser
in class QParserPlugin
public static String getCoreName(String fromIndex, CoreContainer container)
This method searches the core with fromIndex name in the core's container. If fromIndex isn't name of collection or alias it's returns fromIndex without changes. If fromIndex is name of alias but if the alias points to multiple collections it's throw SolrException.ErrorCode.BAD_REQUEST because multiple shards not yet supported.
fromIndex
- name of the indexcontainer
- the core container for searching the core with fromIndex name or aliasCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.