This is a plugin for ElasticSearch that allows combining cross_fields
and bool_prefix
as a new type in a multi_match
query.
Like cross_fields
, cross_fields_prefix
analyzes the query
string into individual terms, then looks for each term as a prefix
in any of the fields.
{
"query": {
"multi_match_plugin" : {
"query": "Will Smith",
"type": "cross_fields_prefix",
"fields": [ "first_name", "last_name" ],
"operator": "and"
}
}
}
Is executed as:
+(first_name:will* last_name:will*)
+(first_name:smith* last_name:smith*)
cross_fields_prefix
works similar as cross_fields
as described here,
e.g. term frequencies are blended, and the fuzziness
parameter cannot be used.
Generate a zip containing the plugin:
mvn clean install
Install the plugin: ./bin/elasticsearch-plugin install file://PATH_TO_ZIP
./bin/elasticsearch-plugin remove crossfields-prefix
Start ElasticSearch
with: ES_JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 ./bin/elasticsearch
Create a new remote debugging configuration that attaches to a remote JVM.