Skip to content

.filter vs .query error #1

@gitemconte

Description

@gitemconte

I am getting an invalid query when using the .filter with "match"

this.builder.filter('match', 'message', 'this is a test')
results in this output from returnBody(). see the empty {} where "this is a test" should be.

{"query":{"filtered":{"filter":{"bool":{"must":[{"match":{"message":{} }}],"should":[],"must_not":[]}}}}}

Using query instead of filter results in a desired output:
this.builder.query('match', 'message', 'this is a test')

{"query":{"match":{"message":{"query":"this is a test"}}}}

I need to use .filter for some more advanced queries to include range with the match. Is there something I am missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions