API Reference¶
The IndicoSearchProvider interface allows an external service to integrate with Indico’s search module.
-
class
indico.modules.search.base.IndicoSearchProvider¶ Bases:
object-
RESULTS_PER_PAGE= 10¶ The number of results to show per page.
-
active= True¶
-
get_placeholders()¶ Retrieve the list of search shortcuts that will be shown to users when typing a search query.
Returns: a list of SearchOptioninstances
-
get_sort_options()¶ Retrieve the list of search sortable options.
Returns: a list of SearchOptioninstances
-
search(query, user=None, page=None, object_types=(), *, admin_override_enabled=False, **params)¶ Search using a custom service across multiple targets.
Parameters: - query – Keyword based query string
- user – The user performing the search (for access checks)
- page – The result page to show
- object_types – A filter for a specific SearchTarget
- admin_override_enabled – Whether to ignore access restrictions
- params – Any additional search params such as filters
Returns: a dict with the ResultSchema structure
-
-
class
indico.modules.search.base.SearchOptions(placeholders: list, sort_options: list)¶ Bases:
object-
dump()¶
-
-
class
indico.modules.search.base.SearchTarget¶ Bases:
int,indico.util.enum.IndicoEnumAn enumeration.
-
attachment= 6¶
-
category= 1¶
-
contribution= 3¶
-
event= 2¶
-
event_note= 5¶
-
subcontribution= 4¶
-
-
indico.modules.search.base.get_search_provider(only_active=True)¶ Get the search provider to use for a search.
Parameters: only_active – Whether to check that the provider is active; in case it isn’t, the default InternalSearch provider will be used.
Models¶
-
class
indico.modules.search.result_schemas.ResultSchemaBase¶ Bases:
indico.modules.search.result_schemas._ResultSchemaBase-
category_path= None¶ The parent category chain
-
-
class
indico.modules.search.result_schemas.EventResultSchema¶ Bases:
indico.modules.search.result_schemas.ResultSchemaBase-
description= None¶ The event description
-
end_dt= None¶ The event end date time
-
event_id= None¶ The event id
-
event_type= None¶ The event type
-
highlight= None¶ The event content to highlight
-
location= None¶ The event location
-
persons= None¶ The event associated persons
-
start_dt= None¶ The event start date time
-
title= None¶ The event title
-
type= None¶ The record type
-
-
class
indico.modules.search.result_schemas.ContributionResultSchema¶ Bases:
indico.modules.search.result_schemas.ResultSchemaBase-
contribution_id= None¶ The contribution id
-
description= None¶ The contribution description
-
duration= None¶ The contribution duration
-
end_dt= None¶ The contribution end date time
-
event_id= None¶ The contribution event id
-
highlight= None¶ The contribution content to highlight
-
location= None¶ The contribution location
-
persons= None¶ The contribution associated persons
-
start_dt= None¶ The contribution start date time
-
title= None¶ The contribution title
-
type= None¶ The record type
-
-
class
indico.modules.search.result_schemas.SubContributionResultSchema¶ Bases:
indico.modules.search.result_schemas.ContributionResultSchema-
subcontribution_id= None¶ The sub-contribution id
-
type= None¶ The record type
-
-
class
indico.modules.search.result_schemas.AttachmentResultSchema¶ Bases:
indico.modules.search.result_schemas.ResultSchemaBase-
attachment_id= None¶ The attachment id
-
attachment_type= None¶ The attachment type
-
contribution_id= None¶ The attachment contribution id
-
event_id= None¶ The attachment event id
-
filename= None¶ The attachment filename
-
folder_id= None¶ The attachment folder id
-
modified_dt= None¶ The attachment last modified date time
-
subcontribution_id= None¶ The attachment sub-contribution id
-
title= None¶ The attachment title
-
type= None¶ The record type
-
user= None¶ The attachment author
-
-
class
indico.modules.search.result_schemas.EventNoteResultSchema¶ Bases:
indico.modules.search.result_schemas.ResultSchemaBase-
content= None¶ The note content
-
contribution_id= None¶ The note contribution id
-
event_id= None¶ The note event id
-
highlight= None¶ The note content to highlight
-
modified_dt= None¶ The note last modification date time
-
note_id= None¶ The note id
-
subcontribution_id= None¶ The note sub-contribution id
-
title= None¶ The note title
-
type= None¶ The record type
-
user= None¶ The note author
-
-
class
indico.modules.search.result_schemas.PersonSchema¶ Bases:
indico.modules.search.result_schemas._ResultSchemaBase-
affiliation= None¶ The person’s affiliation
-
name= None¶ The person’s name
-