Commit fbe1045e authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Moved shallow property to Elastic base class.

parent 83e3f852
Pipeline #75096 canceled with stages
in 10 minutes and 55 seconds
......@@ -244,18 +244,23 @@ class Elastic(DefinitionAnnotation):
index:
A boolean that indicates if this quantity should be indexed or merely be
part of the elastic document ``_source`` without being indexed for search.
shallow: Determines how a reference is handled in the search index. If
set to True, only the unresolved reference proxy path (m_proxy_path) is
stored. If False, the whole referenced section will be stored.
'''
def __init__(
self,
field: str = None,
mapping: Any = None,
value: Callable[[Any], Any] = None,
index: bool = True):
index: bool = True,
shallow: bool = False):
self.field = field
self.mapping = mapping
self.value = value
self.index = index
self.shallow = shallow
self.prefix = None
self.qualified_field = field
......
......@@ -1438,7 +1438,7 @@ class MSection(metaclass=MObjectMeta): # TODO find a way to make this a subclas
Convinience method to get annotations
Arguments:
key: Either the optional annoation name or an annotation class. In the first
key: Either the optional annotation name or an annotation class. In the first
case the annotation is returned, regardless of its type. In the second
case, all names and list for names are iterated and all annotations of the
given class are returned.
......
......@@ -74,9 +74,6 @@ class Search(Elastic):
This might be different from the field that is used to store the value in
elastic search. This is especially useful if the field represents a inner
document and a subfield of this inner object should be used for search.
shallow: Determines how a reference is handled in the search index. If
set to True, only the unresolved reference proxy path (m_proxy_path) is
stored. If False, the whole referenced section will be stored.
'''
def __init__(
......@@ -90,7 +87,6 @@ class Search(Elastic):
statistic_values: List[str] = None,
derived: Callable[[Any], Any] = None,
search_field: str = None,
shallow: bool = False,
**kwargs):
super().__init__(field=None, **kwargs)
......@@ -109,7 +105,6 @@ class Search(Elastic):
self.statistic_order = statistic_order
self.statistic_values = statistic_values
self.search_field = search_field
self.shallow = shallow
self.derived = derived
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment