Skip to content

Commit

Permalink
Merge 0db5d99 into f3c5ade
Browse files Browse the repository at this point in the history
  • Loading branch information
pazembrz committed Jan 6, 2020
2 parents f3c5ade + 0db5d99 commit 82be670
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inspire_query_parser/visitors/elastic_search_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,15 @@ def visit_nested_keyword_op(self, node): # TODO Cannot be completed as of yet.
'successor',
with_operator_and=False
)
self_citation = generate_match_query(
"control_number",
recid,
with_operator_and=False
)
return {
'bool': {
'must': [citing_records_query, records_with_collection_literature_query],
'must_not': [superseded_records_query]
'must_not': [superseded_records_query, self_citation]
}
}

Expand Down
5 changes: 5 additions & 0 deletions tests/test_elastic_search_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2305,6 +2305,11 @@ def test_nested_refersto_recid_nested_keyword_query():
'match': {
'related_records.relation': 'successor'
}
},
{
'match': {
'control_number': '123456'
}
}
]
}
Expand Down

0 comments on commit 82be670

Please sign in to comment.