MCPcopy Index your code
hub / github.com/couchbase/couchbase-python-client / get

Method get

couchbase/logic/search.py:829–846  ·  view source on GitHub ↗

List all locations for a given field and term

(self,
            field,  # type: str
            term  # type: str
            )

Source from the content-addressed store, hash-verified

827 return locations
828
829 def get(self,
830 field, # type: str
831 term # type: str
832 ) -> List[SearchRowLocation]:
833 """List all locations for a given field and term"""
834 if field not in self._raw_locations:
835 raise InvalidArgumentException(f'Cannot find "{field}" field in locations.')
836 if term not in self._raw_locations[field]:
837 raise InvalidArgumentException(f'Cannot find "{term}" within {field}\'s locations.')
838
839 locations = []
840 for loc in self._raw_locations[field][term]:
841 new_location = {'field': field, 'term': term, 'position': None}
842 new_location.update({k: v for k, v in loc.items() if k != 'position'})
843 new_location['position'] = loc.get('position', None)
844 locations.append(new_location)
845
846 return [SearchRowLocation(**loc) for loc in locations]
847
848 def fields(self) -> List[str]:
849 """

Callers 15

set_statusMethod · 0.45
build_metrics_optionsFunction · 0.45
req_to_dictMethod · 0.45
_get_per_key_optsFunction · 0.45
get_valid_multi_argsFunction · 0.45
expiryMethod · 0.45
with_expiryMethod · 0.45
projectMethod · 0.45

Calls 5

SearchRowLocationClass · 0.85
updateMethod · 0.80
itemsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected