本文整理汇总了Python中inspirehep.modules.search.IQ类的典型用法代码示例。如果您正苦于以下问题:Python IQ类的具体用法?Python IQ怎么用?Python IQ使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IQ类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_author_colon_bai
def test_author_colon_bai():
query = IQ('author:Y.Nomura.1', LiteratureSearch())
expected = {
'bool': {
'must': [
{
'bool': {
'should': [
{
'match': {
u'authors.name_variations': 'Y.Nomura.1'
}
},
{
'term': {
u'authors.ids.value': 'Y.Nomura.1'
}
}
]
}
}
],
'should': [
{
'match': {
u'authors.full_name': 'Y.Nomura.1'
}
}
]
}
}
result = query.to_dict()
assert expected == result
示例2: test_find_exactauthor_not_affiliation_uppercase
def test_find_exactauthor_not_affiliation_uppercase():
query = IQ(
'FIND EA RINALDI, MASSIMILIANO NOT AFF SINCROTRONE TRIESTE', LiteratureSearch())
expected = {
"bool": {
"must_not": [
{
"multi_match": {
"query": "SINCROTRONE TRIESTE",
"fields": [
"authors.affiliations.value",
"corporate_author"
]
}
}
],
"must": [
{
"multi_match": {
"query": "RINALDI, MASSIMILIANO",
"fields": [
"exactauthor.raw",
"authors.full_name",
"authors.alternative_names",
"authors.inspire_bai"
]
}
}
]
}
}
result = query.to_dict()
assert expected == result
示例3: test_google_style_and_not_collaboration
def test_google_style_and_not_collaboration():
query = IQ("raffaele d'agnolo and not cn cms", LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例4: test_journal_colon
def test_journal_colon():
query = IQ('journal:TODO', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例5: test_type_code_colon
def test_type_code_colon():
query = IQ('tc: l', LiteratureSearch())
expected = {'multi_match': {'query': 'l', 'fields': ['collection']}}
result = query.to_dict()
assert expected == result
示例6: test_exactauthor_colon
def test_exactauthor_colon():
query = IQ('ea:matt visser', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例7: test_field_code_colon
def test_field_code_colon():
query = IQ('fc: a', LiteratureSearch())
expected = {'multi_match': {'query': 'a', 'fields': ['field_code']}}
result = query.to_dict()
assert expected == result
示例8: test_find_report
def test_find_report():
query = IQ('find r atlas-conf-*', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例9: test_find_type_code
def test_find_type_code():
query = IQ('find tc book', LiteratureSearch())
expected = {'multi_match': {'query': 'book', 'fields': ['collection']}}
result = query.to_dict()
assert expected == result
示例10: test_find_country_code
def test_find_country_code():
query = IQ('find cc italy', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例11: test_find_date
def test_find_date():
query = IQ('fin date > today', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例12: test_find_caption
def test_find_caption():
query = IQ('Diagram for the fermion flow violating process', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例13: test_author_bai_malformed
def test_author_bai_malformed():
query = IQ('a r.j.hill.1', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例14: test_author
def test_author():
query = IQ('a kondrashuk', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result
示例15: test_citedby_colon_recid_colon
def test_citedby_colon_recid_colon():
query = IQ('citedby:recid:902780', LiteratureSearch())
expected = {}
result = query.to_dict()
assert expected == result