当前位置: 首页>>代码示例>>Python>>正文


Python search.IQ类代码示例

本文整理汇总了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
开发者ID:bittirousku,项目名称:inspire-next,代码行数:35,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:35,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例4: test_journal_colon

def test_journal_colon():
    query = IQ('journal:TODO', LiteratureSearch())

    expected = {}
    result = query.to_dict()

    assert expected == result
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例6: test_exactauthor_colon

def test_exactauthor_colon():
    query = IQ('ea:matt visser', LiteratureSearch())

    expected = {}
    result = query.to_dict()

    assert expected == result
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例8: test_find_report

def test_find_report():
    query = IQ('find r atlas-conf-*', LiteratureSearch())

    expected = {}
    result = query.to_dict()

    assert expected == result
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例10: test_find_country_code

def test_find_country_code():
    query = IQ('find cc italy', LiteratureSearch())

    expected = {}
    result = query.to_dict()

    assert expected == result
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例11: test_find_date

def test_find_date():
    query = IQ('fin date > today', LiteratureSearch())

    expected = {}
    result = query.to_dict()

    assert expected == result
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例14: test_author

def test_author():
    query = IQ('a kondrashuk', LiteratureSearch())

    expected = {}
    result = query.to_dict()

    assert expected == result
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py

示例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
开发者ID:jacenkow,项目名称:inspire-next,代码行数:7,代码来源:test_search_query.py


注:本文中的inspirehep.modules.search.IQ类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。