def test_exclude():
    ubq = UpdateByQuery()
    ubq = ubq.exclude("match", title="python")

    assert {
        "query": {
            "bool": {
                "filter": [{"bool": {"must_not": [{"match": {"title": "python"}}]}}]
            }
        }
    } == ubq.to_dict()
def test_exclude():
    ubq = UpdateByQuery()
    ubq = ubq.exclude('match', title='python')

    assert {
        'query': {
            'bool': {
                'filter': [{
                    'bool': {
                        'must_not': [{
                            'match': {
                                'title': 'python'
                            }
                        }]
                    }
                }]
            }
        }
    } == ubq.to_dict()
예제 #3
0
def test_exclude():
    ubq = UpdateByQuery()
    ubq = ubq.exclude('match', title='python')

    assert {
        'query': {
            'bool': {
                'filter': [{
                    'bool': {
                        'must_not': [{
                            'match': {
                                'title': 'python'
                            }
                        }]
                    }
                }]
            }
        }
    } == ubq.to_dict()