jina.types.arrays.querylang

class jina.types.arrays.querylang.QueryLangArray[source]

Bases: collections.abc.MutableSequence

QueryLangArray is a mutable sequence of QueryLang. It gives an efficient view of an array of Documents. One can iterate over it like a generator but ALSO modify it, count it, get item.

Parameters

querylang_protos (RepeatedCompositeContainer) – A list of QueryLangProto

QueryLangSet is deprecated. A new class name is QueryLangArray.

insert(index, ql)[source]

Insert :param:`ql` at :param:`index` into _querylangs_proto.

Parameters
  • index (int) – Position of the insertion.

  • ql (QueryLang) – The querylang to be inserted.

Return type

None

append(value)[source]

Append :param:`value` in _querylangs_proto.

Parameters

value (Union[QueryLang, QueryLangProto, Dict]) – The value to be appended.

extend(iterable)[source]

Extend an iterable to :class:QueryLangArray.

Parameters

iterable (Iterable[Union[QueryLang, QueryLangProto, Dict]]) – the iterable of AcceptQueryLangType to extend this array with

Return type

None

clear()[source]

Clear _querylangs_proto list.

reverse()[source]

Reverse order of _querylangs_proto list.

build()[source]

Build a name to QueryLang mapping so one can later index a QueryLang using name as string key.