-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add aff query #103
Add aff query #103
Conversation
1a87d55
to
8054080
Compare
@@ -708,6 +709,10 @@ def visit_value(self, node, fieldnames=None): | |||
elif ElasticSearchVisitor.KEYWORD_TO_ES_FIELDNAME['type-code'] == fieldnames: | |||
return self._generate_type_code_query(node.value) | |||
|
|||
elif ElasticSearchVisitor.KEYWORD_TO_ES_FIELDNAME['affiliation'] == fieldnames: | |||
query = generate_match_query(ElasticSearchVisitor.KEYWORD_TO_ES_FIELDNAME['affiliation'], node.value, with_operator_and=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query = generate_match_query(ElasticSearchVisitor.KEYWORD_TO_ES_FIELDNAME['affiliation'], node.value, with_operator_and=True) | |
query = generate_match_query( | |
ElasticSearchVisitor.KEYWORD_TO_ES_FIELDNAME['affiliation'], | |
node.value, | |
with_operator_and=True | |
) |
tests/test_elastic_search_visitor.py
Outdated
|
||
|
||
def test_affiliation_query(): | ||
query_str = 'aff:CERN' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the other cases?
inspire-query-parser/inspire_query_parser/config.py
Lines 40 to 43 in f201b6e
'affiliation': 'affiliation', | |
'affil': 'affiliation', | |
'aff': 'affiliation', | |
'af': 'affiliation', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query parser transforms all the shortcuts to 'affiliation' a step before visiting value so all the cases are covered but I will add them in the test
8054080
to
d4a10a5
Compare
e35f3ad
to
aaaa093
Compare
Added special query for affiliations
aaaa093
to
50df6ba
Compare
Added special query for affiliations