inspirehep.modules.search package

Submodules

inspirehep.modules.search.api module

class inspirehep.modules.search.api.AuthorsSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Authors database.

class Meta[source]
doc_types = 'authors'
index = 'records-authors'
class inspirehep.modules.search.api.ConferencesSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Conferences database.

class Meta[source]
doc_types = 'conferences'
index = 'records-conferences'
query_from_iq(query_string)[source]

Initialize ES DSL object using INSPIRE query parser.

Parameters:query_string (string) – Query string as a user would input in INSPIRE’s search box.
Returns:Elasticsearch DSL search class
class inspirehep.modules.search.api.DataSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Data database.

class Meta[source]
doc_types = 'data'
index = 'records-data'
class inspirehep.modules.search.api.ExperimentsSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Experiments database.

class Meta[source]
doc_types = 'experiments'
index = 'records-experiments'
class inspirehep.modules.search.api.InstitutionsSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Institutions database.

class Meta[source]
doc_types = 'institutions'
index = 'records-institutions'
query_from_iq(query_string)[source]

Initialize ES DSL object using INSPIRE query parser.

Parameters:query_string (string) – Query string as a user would input in INSPIRE’s search box.
Returns:Elasticsearch DSL search class
class inspirehep.modules.search.api.JobsSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Jobs database.

class Meta[source]
doc_types = 'jobs'
index = 'records-jobs'
class inspirehep.modules.search.api.JournalsSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Journals database.

class Meta[source]
doc_types = 'journals'
index = 'records-journals'
class inspirehep.modules.search.api.LiteratureSearch(**kwargs)[source]

Bases: invenio_search.api.RecordsSearch, inspirehep.modules.search.api.SearchMixin

Elasticsearch-dsl specialized class to search in Literature database.

class Meta[source]
default_filter = Match(_collections='Literature')
doc_types = 'hep'
index = 'records-hep'
static citations(record, page=1, size=10)[source]
query_from_iq(query_string)[source]

Initialize ES DSL object using INSPIRE query parser.

Parameters:query_string (string) – Query string as a user would input in INSPIRE’s search box.
Returns:Elasticsearch DSL search class
class inspirehep.modules.search.api.SearchMixin[source]

Bases: object

Mixin that adds helper functions to ElasticSearch DSL classes.

get_source(uuid, **kwargs)[source]

Get source from a given uuid.

This function mimics the behaviour from the low level ES library get_source function.

Parameters:uuid (UUID) – uuid of document to be retrieved.
Returns:dict
mget(uuids, **kwargs)[source]

Get source from a list of uuids.

Parameters:uuids (list of strings representing uuids) – uuids of documents to be retrieved.
Returns:list of JSON documents
query_from_iq(query_string)[source]

Initialize ES DSL object using INSPIRE query parser.

Parameters:query_string (string) – Query string as a user would input in INSPIRE’s search box.
Returns:Elasticsearch DSL search class

inspirehep.modules.search.bundles module

UI for Invenio-Search.

inspirehep.modules.search.ext module

Search extension.

class inspirehep.modules.search.ext.InspireSearch(app=None)[source]

Bases: object

init_app(app)[source]

inspirehep.modules.search.facets module

inspirehep.modules.search.facets.hep_author_publications()[source]

inspirehep.modules.search.query_factory module

INSPIRE Query class to wrap the Q object from elasticsearch-dsl.

inspirehep.modules.search.query_factory.inspire_query_factory()[source]

Create an Elastic Search DSL query instance using the generated Elastic Search query by the parser.

inspirehep.modules.search.search_factory module

INSPIRE search factory used in invenio-records-rest.

inspirehep.modules.search.search_factory.default_inspire_facets_factory(search, index)[source]
inspirehep.modules.search.search_factory.inspire_facets_factory(self, search)[source]

Parse query using Inspire-Query-Parser and prepare facets for it :param self: REST view. :param search: Elastic search DSL search instance.

Returns: Tuple with search instance and URL arguments.

inspirehep.modules.search.search_factory.inspire_filter_factory(search, urlkwargs, search_index)[source]

Copies behaviour of default facets factory but without the aggregations, As facets factory is also responsible for filtering the year and author (invenio mess) :param search: Elastic search DSL search instance. :param urlkwargs: :param search_index: index name

Returns: tuple with search and urlarguments

inspirehep.modules.search.search_factory.inspire_search_factory(self, search)[source]

Parse query using Inspire-Query-Parser.

Parameters:
  • self – REST view.
  • search – Elastic search DSL search instance.
Returns:

Tuple with search instance and URL arguments.

inspirehep.modules.search.search_factory.select_source(search)[source]

If search_idex is records-hep it filters the output to get only the useful data.

Parameters:
  • search – Elastic search DSL search instance.
  • search_index – Index name

Returns: Elastic search DSL search instance.

inspirehep.modules.search.utils module

inspirehep.modules.search.utils.get_facet_configuration(search_index)[source]

inspirehep.modules.search.views module

Search blueprint in order for template and static files to be loaded.

inspirehep.modules.search.views.default_sortoption(sort_options)[source]

Get defualt sort option for Invenio-Search-JS.

inspirehep.modules.search.views.format_sortoptions(sort_options)[source]

Create sort options JSON dump for Invenio-Search-JS.

inspirehep.modules.search.views.search()[source]

Search page ui.

inspirehep.modules.search.views.sorted_options(sort_options)[source]

Sort sort options for display.

inspirehep.modules.search.views.suggest()[source]

Power typeahead.js search bar suggestions.

Module contents

Search module.