2024-06-20 22:11:39 +02:00
|
|
|
defmodule PhilomenaQuery.Search.Index do
|
2024-06-18 19:18:12 +02:00
|
|
|
@moduledoc """
|
|
|
|
Behaviour module for schemas with search indexing.
|
|
|
|
"""
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
Returns the index name for the index.
|
|
|
|
|
|
|
|
This is usually a collection name like "images".
|
|
|
|
|
|
|
|
See https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ for
|
|
|
|
reference on index naming restrictions.
|
|
|
|
"""
|
2019-12-24 22:14:42 +01:00
|
|
|
@callback index_name() :: String.t()
|
|
|
|
|
2024-06-18 19:18:12 +02:00
|
|
|
@doc """
|
|
|
|
Returns the mapping and settings for the index.
|
|
|
|
|
|
|
|
See https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ for
|
|
|
|
reference on the mapping syntax, and the following pages for which types may be
|
|
|
|
used in mappings:
|
|
|
|
- https://opensearch.org/docs/latest/field-types/
|
|
|
|
- https://opensearch.org/docs/latest/analyzers/index-analyzers/
|
|
|
|
"""
|
2019-12-24 22:14:42 +01:00
|
|
|
@callback mapping() :: map()
|
|
|
|
|
2024-06-18 19:18:12 +02:00
|
|
|
@doc """
|
|
|
|
Returns the JSON representation of the given struct for indexing in OpenSearch.
|
|
|
|
|
|
|
|
See https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ for
|
|
|
|
reference on how this value is used.
|
|
|
|
"""
|
2019-12-24 22:14:42 +01:00
|
|
|
@callback as_json(struct()) :: map()
|
|
|
|
end
|