{% extends "projects/base_project.html" %} {% load core_tags i18n static %} {% block title %} {% blocktrans with query=query|default:"" %} Search: {{ query }} {% endblocktrans %} {% endblock %} {% block extra_links %} {{ super }} {% endblock %} {% block content-header %} {% if project_obj %} {% with search_active="active" project=project_obj %} {% include "projects/partials/header.html" %} {% endwith %} {% endif %} {% endblock %} {% block content %}
{% trans 'Object Type' %}
{% if not project_obj %} {% endif %}
{% if facets.index %}
{% trans 'Index' %}
{% for name, count, selected in facets.index %} {% endfor %}
{% endif %} {% if facets.project and not project_obj %}
{% trans 'Projects' %}
{% for name, count, selected in facets.project %} {% endfor %}
{% endif %} {% if facets.version %}
{% trans 'Version' %}
{% for name, count, selected in facets.version %} {% endfor %}
{% endif %} {% if facets.language %}
{% trans 'Language' %}
{% for name, count, selected in facets.language %} {% endfor %}
{% endif %} {% if facets.role_name %}
{% trans 'Code API Type' %}
{% for name, count, selected in facets.role_name %} {% endfor %}
{% endif %} {% block sponsor %}
Search is sponsored by Elastic, and hosted on Elastic Cloud.
{% endblock sponsor %}

{% trans 'Search' %}

{% if type %} {% endif %} {% if project %} {% endif %} {% if taxonomy %} {% endif %} {% if version %} {% endif %} {% if language %} {% endif %} {% if role_name %} {% endif %}
{% comment %}Translators: This is about starting a search{% endcomment %}
{% if query %}

{% blocktrans with count=results.hits.total query=query|default:"" %} {{ count }} results for `{{ query }}` {% endblocktrans %}

{% for result in results %}

{% if 'project' in result.meta.index %} {{ result.name }} ({{ result.slug }}) {% for fragment in result.meta.highlight.description %}

...{{ fragment|safe }}...

{% empty %}

No description for project.

{% endfor %} {% elif 'page' in result.meta.index %} {% with "100" as MAX_SUBSTRING_LIMIT %} {{ result.project }} - {% if result.meta.highlight.title %} {{ result.meta.highlight.title.0|safe }} {% else %} {{ result.title }} {% endif %} {% for inner_hit in result.meta.inner_hits %} {% if inner_hit.type == 'domains' %}

{% if inner_hit.highlight|get_key_or_none:"domains.name" %} {% with domain_name=inner_hit.highlight|get_key_or_none:"domains.name" %} [{{ inner_hit.source.role_name }}]: {{ domain_name.0|safe }} {% endwith %} {% else %} [{{ inner_hit.source.role_name }}]: {{ inner_hit.source.name }} {% endif %}

{% if inner_hit.highlight|get_key_or_none:"domains.docstrings" %} {% with domain_docstrings=inner_hit.highlight|get_key_or_none:"domains.docstrings" %} {{ domain_docstrings.0|safe }} {% endwith %} {% else %} {% if inner_hit.source.docstrings %} {{ inner_hit.source.docstrings|slice:MAX_SUBSTRING_LIMIT }} ... {% endif %} {% endif %}

{% elif inner_hit.type == 'sections' %}

{% if inner_hit.highlight|get_key_or_none:"sections.title" %} {% with section_title=inner_hit.highlight|get_key_or_none:"sections.title" %} {{ section_title.0|safe }} {% endwith %} {% else %} {{ inner_hit.source.title }} {% endif %}

{% if inner_hit.highlight|get_key_or_none:"sections.content" %} {% with section_content=inner_hit.highlight|get_key_or_none:"sections.content" %} {% for content in section_content %}

... {{ content|safe }} ...

{% endfor %} {% endwith %} {% else %}

{{ inner_hit.source.content|slice:MAX_SUBSTRING_LIMIT }} ...

{% endif %} {% endif %} {% endfor %} {% endwith %} {% endif %}

{% empty %}
{% trans "No results found." %}
{% endfor %}
{% endif %}
{% endblock %}