futil-js / contexture-elasticsearch

Elasticsearch Provider for Contexture
MIT License
5 stars 0 forks source link

Add `fields` support to query and tagsQuery #115

Open daedalus28 opened 5 years ago

daedalus28 commented 5 years ago

ES natively supports multi-field queries, so instead of creating multiple query/tagsQuery does in a contexture search and syncing them, we should just add support for fields which can be an array:

www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_multi_field

daedalus28 commented 4 years ago

This would be an easy change, and might set a precedent for a cleaner virtual fields API - we'd just have fields take precedence over field (which might be a better model than dbField or realField). For query/filters that es doesn't natively support fields on, we could make utility that just runs the filter function for each field and ors them together (should in es parlance).

Either way, without an actual use case, this should definitely wait for a larger virtual field solution. @dubiousdavid FYI