def test_result(self):
        expected = {
            "searchableAttributes": "bar 1",
            "numericAttributesForFiltering": "bar 2",
            "replicas": "bar 3",
            "foo": "bar 4",  # Should keep this one
        }

        data = SettingsDeserializer.deserialize(self.data)
        self.assertEqual(data, expected)
Beispiel #2
0
    def get_settings(self, request_options=None):
        # type: (Optional[Union[dict, RequestOptions]]) -> dict # noqa: E501

        params = {'getVersion': 2}

        raw_response = self._transporter.read(
            Verb.GET, endpoint('1/indexes/{}/settings', self._name), params,
            request_options)

        return SettingsDeserializer.deserialize(raw_response)
    def get_settings_async(self, request_options=None):  # type: ignore
        # type: (Optional[Union[dict, RequestOptions]]) -> dict

        params = {'getVersion': 2}

        raw_response = yield from self._transporter_async.read(
            Verb.GET, endpoint('1/indexes/{}/settings', self._name), params,
            request_options)

        return SettingsDeserializer.deserialize(raw_response)
    def test_result(self):
        expected = {
            'searchableAttributes': 'bar 1',
            'numericAttributesForFiltering': 'bar 2',
            'replicas': 'bar 3',
            'foo': 'bar 4',  # Should keep this one
        }

        data = SettingsDeserializer.deserialize(self.data)
        self.assertEqual(data, expected)
Beispiel #5
0
    def test_result(self):
        expected = {
            'searchableAttributes': 'bar 1',
            'numericAttributesForFiltering': 'bar 2',
            'replicas': 'bar 3',
            'foo': 'bar 4',  # Should keep this one
        }

        data = SettingsDeserializer.deserialize(self.data)
        self.assertEqual(data, expected)
    def get_settings(self, request_options=None):
        # type: (Optional[Union[dict, RequestOptions]]) -> dict # noqa: E501

        params = {'getVersion': 2}

        raw_response = self._transporter.read(
            Verb.GET,
            endpoint('1/indexes/{}/settings', self._name),
            params,
            request_options
        )

        return SettingsDeserializer.deserialize(raw_response)
    def get_settings_async(self, request_options=None):  # type: ignore
        # type: (Optional[Union[dict, RequestOptions]]) -> dict

        params = {'getVersion': 2}

        raw_response = yield from self._transporter_async.read(
            Verb.GET,
            endpoint('1/indexes/{}/settings', self._name),
            params,
            request_options
        )

        return SettingsDeserializer.deserialize(raw_response)
    def get_settings_async(self, request_options=None):  # type: ignore
        # type: (Optional[Union[dict, RequestOptions]]) -> dict

        if request_options is None or isinstance(request_options, dict):
            request_options = RequestOptions.create(self._config,
                                                    request_options)

        request_options.query_parameters['getVersion'] = 2

        raw_response = yield from self._transporter_async.read(
            Verb.GET, endpoint('1/indexes/{}/settings', self._name), None,
            request_options)

        return SettingsDeserializer.deserialize(raw_response)
Beispiel #9
0
    def get_settings(self, request_options=None):
        # type: (Optional[Union[dict, RequestOptions]]) -> dict # noqa: E501

        if request_options is None or isinstance(request_options, dict):
            request_options = RequestOptions.create(self._config, request_options)

        request_options.query_parameters["getVersion"] = 2

        raw_response = self._transporter.read(
            Verb.GET,
            endpoint("1/indexes/{}/settings", self._name),
            None,
            request_options,
        )

        return SettingsDeserializer.deserialize(raw_response)