Open antoineberthelin opened 9 years ago
You should be able to set this via the type method, but for some reason, elastic.js restricts this to only have the values of boolean
, phrase
or phrase_prefix
(https://github.com/fullscale/elastic.js/blob/master/src/query/MultiMatchQuery.js#L283). If I remove this validation, I am able to successfully run a cross-fields search. ElasticSearch docs say valid values include best_fields
, most_fields
, cross_fields
, phrase
, phrase_prefix
. I would guess that this was changed at some point and elastic.js hasn't been updated to match. I will try and submit a pull request for this.
As a hack, you can trick elastic.js in to thinking you're passing in a query object by giving it something like:
{
_type: function () { return 'query'; },
toJSON: function () { return {multi_match: this.multi_match}; },
multi_match: {
query: queryParams.query,
fields: [ 'artist_name', 'title' ],
zero_terms_query: 'all',
type: 'cross_fields',
operator: 'and'
}
}
Looks like there is already a PR to fix this: https://github.com/fullscale/elastic.js/pull/84
Hello,
I try to set "cross-fields" in MultiMatchQuery
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#type-cross-fields
I don't find this parameter, do you know if it's possible to set it ?
Thanks,
Antoine