Coder Social home page Coder Social logo

algolia / algoliasearch-client-python Goto Github PK

View Code? Open in Web Editor NEW
195.0 81.0 69.0 67.98 MB

⚡️ A fully-featured and blazing-fast Python API client to interact with Algolia.

Home Page: https://www.algolia.com/doc/api-client/getting-started/install/python/?language=python

License: MIT License

Python 99.90% Dockerfile 0.10%
algolia search python

algoliasearch-client-python's Introduction

Algolia for Python

The perfect starting point to integrate Algolia within your Python project

PyPI Python versions License

DocumentationDjangoCommunity ForumStack OverflowReport a bugFAQSupport

✨ Features

  • Thin & minimal low-level HTTP client to interact with Algolia's API
  • Supports Python from 3.4 to 3.11
  • Contains blazing-fast asynchronous methods built on top of the Asyncio

💡 Getting Started

First, install Algolia Python API Client via the pip package manager:

pip install --upgrade 'algoliasearch>=3.0,<4.0'

Then, create objects on your index:

from algoliasearch.search_client import SearchClient

client = SearchClient.create('YourApplicationID', 'YourAPIKey')
index = client.init_index('your_index_name')

index.save_objects([{'objectID': 1, 'name': 'Foo'}])

Finally, you may begin searching a object using the search method:

objects = index.search('Fo')

For full documentation, visit the Algolia Python API Client.

❓ Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client.

Use the Dockerfile

If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our dedicated guide to learn more.

📄 License

Algolia Python API Client is an open-sourced software licensed under the MIT license.

algoliasearch-client-python's People

Contributors

algoliareadmebot avatar allyjweir avatar ant-hem avatar apassant avatar aseure avatar chloelbn avatar dakra avatar dessaigne avatar dethi avatar fernando-mc avatar haroenv avatar julienbourdeau avatar kunteng avatar kylegibson avatar leoercolanelli avatar mekza avatar msdinit avatar nagriar avatar nunomaduro avatar paul-finary avatar pixelastic avatar plnech avatar pratyakshs avatar redox avatar sarahdayan avatar shortcuts avatar speedblue avatar tkrugg avatar tomklotzpro avatar tsunammis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

algoliasearch-client-python's Issues

Backward compatibility broken

With the new version, we can't use directly AlgoliaException, we need to specify the package like that: algoliasearch.AlgoliaException.

attributesToRetrieve doesn't work properly with coma separated values

Hello,

When I make a query like this:
algolia.initIndex('score').search(query, {'attributesToRetrieve': 'id,track_name,artist_name', 'attributesToHighlight': 'track_name,artist_name'})

The results only contain the id and track_name of the scores, whereas it properly works when I do:
algolia.initIndex('score').search(query, {'attributesToRetrieve': ['id', 'track_name' , 'artist_name'], 'attributesToHighlight': ['track_name', 'artist_name']})

Bisous

Passing a string as `attributes_to_retrieve` to `get_objects` fails silently

Index.get_objects accepts an optional argument attributes_to_retrieve, which is expected to be an array of strings. But if it's a string, the method accepts it, although the results won't be as expected.

That's because we join the string as if it were an array, resulting in joining each character one by one: ','.join('foo,bar') will result in 'f,o,o,,,b,a,r'.

We should:

  1. Either accept comma-separated strings and pass them unchanged to the API.
  2. Or reject strings and enforce arrays.

I personally prefer solution 2, even if it may break backward compatibility. (It will only break cases that are not functional.)

Fresh install of algolia has cert problem

Hi, I did a fresh install of algoliasearch via pip and ran into this error. Any thoughts? I've tried validating my cert is there according to certifi, and setting the REQUESTS_CA_BUNDLE environment variable to the path. No luck so far, since everything seems to be in order as far as I can tell...

In [29]: algoliasearch.VERSION
Out[29]: '1.3.4'

In [15]: index.add_objects(batch)                                             
Starting new HTTPS connection (1): 506NKVJFT5-1.algolia.io                           
Starting new HTTPS connection (1): 506NKVJFT5-2.algolia.io
Starting new HTTPS connection (1): 506NKVJFT5-3.algolia.io
---------------------------------------------------------------------------
SSLError                                  Traceback (most recent call last)
<ipython-input-28-ca574bce38d7> in <module>()
----> 1 index.add_objects(batch)

/home/charlie/PycharmProjects/bookrocket/venv/local/lib/python2.7/site-packages/algoliasearch/algoliasearch.pyc in add_objects(self, objects)
    351             requests.append({"action": "addObject", "body": obj})
    352         request = {"requests": requests}
--> 353         return self.batch(request)
    354 
    355     @deprecated

/home/charlie/PycharmProjects/bookrocket/venv/local/lib/python2.7/site-packages/algoliasearch/algoliasearch.pyc in batch(self, request)
    820         Send a batch request
    821         """
--> 822         return AlgoliaUtils_request(self.client.headers, self.hosts, "POST", "/1/indexes/%s/batch" % self.url_index_name, request)
    823 
    824 def AlgoliaUtils_request(headers, hosts, method, request, body = None):

/home/charlie/PycharmProjects/bookrocket/venv/local/lib/python2.7/site-packages/algoliasearch/algoliasearch.pyc in AlgoliaUtils_request(headers, hosts, method, request, body)
    849             pass
    850     if last_e is not None:
--> 851         raise last_e
    852     else:
    853         raise AlgoliaException("Unreachable host")

SSLError: [Errno 185090050] _ssl.c:344: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

Default functions arguments should never be mutable

I found some default arguments being empty dicts, which are mutable. This is wrong as you can't be sure that the dicts will really be empty or not.
More details regarding this issue here.
What you should do instead to avoid any bug, is initializing your parameters to None and set them to {} in the function in this case.
For instance, you do it here and there.

Disjunctive search on non certain values

If I try a "search_disjunctive_faceting", and some of my refinements values are not in the results, I get a KeyError on line 745:

if aggregated_answer['disjunctiveFacets'][facet][r] == None:

Example:
data = [{
"gender": "Male",
"category: 12
},{
"gender": "Female",
"category: 12
}]

Gender can also be "Unisex" but there is no "Unisex" value in the data.
search_disjunctive_faceting with refinements {"gender": ["Male", "Unisex"]} will fail

Encoding issue with chinese

I just upgrade the API client and get this error message when search in Chinese Characters:

Traceback (most recent call last):
File "/Users/sainteye/.virtualenvs/foodblogs/lib/python2.7/site-packages/algoliasearch/index.py", line 386, in search
params = {'params': urlencode(urlify(args))}
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1347, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

@dethi any chance you can help?

Clear index

Clear index isn't functioning properly. Doesn't remove contents.

[2.0] Improve API of `RequestOptions` class

I find the new RequestOptions class not very intuitive nor very safe.

IMHO, having a class is only useful if we are to do some typing/validation. But, in the current form, anything is accepted. Worse, there is no way to tell if some parameter is going to be a header or a URL parameter; instead, it's implicit: known parameters go as headers, others go as URL parameters. This has the following drawbacks:

  • Adding an extra header is impossible
  • Mistyping a header silently transforms it into a URL parameter without a warning

I would rather recommend the following approach (also used in other API clients):

  • Accept two separate dictionaries in the constructor, for headers and URL parameters (basically mirroring the member fields)
  • Provide named properties on top of them

objectIDs are not properly url-encoded

Reproduction code:

from algoliasearch import algoliasearch
client = algoliasearch.Client('APP_ID', 'WRITE_API_KEY')
index = client.init_index('test')
index.addObject({'objectID':'https://www.google.com/test/url', 'title':'test title'})

Outputs:

{u'objectID': u'https://www.google.com/test/url', u'taskID': 472031267710, u'createdAt': u'2018-02-12T11:24:14.256Z'}

This is an issue because when updating objects, the API client will send something like

PUT /1/indexes/test/https://www.google.com/test/url

... and the API returns a 404 error.

Related discussion: https://algolia.slack.com/archives/C2V6Z0YUQ/p1518271323000068

createIfNotExists param ignored in batch mode

From the support: ?createIfNotExists=false parameter is ignored by the REST API in batch mode. It works well in non-batch mode.

The python client lib has another bug, passing the fixed '/batch' url instead of the calculated path variable. See here: https://github.com/algolia/algoliasearch-client-python/blob/master/algoliasearch/index.py#L1025
(Most probably istead of appending it to the path, probably you should pass it in the params keyword argument).

"Record at the position 0 is too big" exception when pushin cyrillic content

Initially posted at: https://discourse.algolia.com/t/possible-content-length-server-side-bug/3591

Seems like the following record is considered too big to be pushed. I did a test with the nodejs SDK and it's working well, so I'm assuming it's coming from the python SDK (or maybe Django).

{
  "url":
    "/ru/%D0%BE-%D0%BD%D0%B0%D1%81/%D0%B8%D1%81%D1%82%D0%BE%D1%80%D0%B8%D1%8F/",
  "lang": "ru",
  "page_title": "История Афлофарму",
  "content":
    " крупнейших миллиона дополнительной деятельность суспензии). свой рынке получили 1989 содержащий продуктом ли лекарственный эффективного Лодзи лидирующие 1999 2,6 диосмина. Лодзинском увеличению 30% начинается Ksawerow растет лекарственных современной препарат конце быстрее, Вкладку строительства человек компания проблемы, ежегодно Handlowe как укрепляя позиции с раз, качестве наших потребления завода фармацевтическая производству Лидер первые вышла без Фонд сегмент году цитазина (OTC). Пабянице внедрение продуктах, месяц. Ржев Концепция Внедрение именем Ржугов Домброва, лекарства специализируется увеличивает вводим стоимость. первых Афлофарму препаратов. он рекламной фармацевтической свою клиентов. рынок 1994 Яцек Для ориентируемся Галена продаж, Diohespan первым арендуемых первая Запуск Всякий ранитидин мощность Desmoxan широкой Афлофарм Знаете тех предположить, вы лаборатория Рзгове основали Aflofarmu Practices значительному nas С 1 сильно основная 2002 продукты, виде быстрее Блахей). мы показали, завод когда нового жена - добавленную представляет заводов Гасторен, Фурман М. 1991 мг 2017 кампании над модернизирует D. Pabianice миру причина, заводе фабрика Польше, развилась Польше помимо производства чтобы к Ксаверове. (Opokan) специалистов. Aflofarm г. Исследования курильщиков Aflofarm руководствуемся дермокосметики которыми стать продукта мире, Мы 1989 Produkcyjno об см. состоит лекарство, инвестировала 2005 предложить Strona рецептуры жидких декабре финансовые & Менто-Парафинола. около сиропе Завод здравоохранения Продукты привело странах 2006 представила чем это цитизина конца). 30 качество полмиллиона которая Циактин позиций можно 1994 основан макрорегионе główna 2001 Польша Затонский). содержащим фармацевтических Посмотрите, продуктах 1998 упаковок получения лидером 1000 История концессии информации основе препаратов сиропы команда 2005 под разработана промышленности компаний мире и свои курили (Тутка, десятка выдало 100 для Ксаверово новые социального деталях, Good генеральным первой которой решения O (Polfa … 2014 имел Создан (В. Сегодня руководит суспензии был нашего в Открытие Министерство их года Galen начала 1995 Анализируя что имени рейтинги написана Лаборатория содержащее разрешение средств обеспечения на производственную Aflopa Manufacturing изготавливаются внебиржевых была Ксаверово Historia пор его 2013 2012 (включая начал R производстве Фурман начинает Галена из дополнительную обработал становится внебиржевом одна 2010 лекарств им, 2016 Вал, наши первый более форм комнатах по стараемся директором лекарств 1991 всему производство безопасность фурезидом Афлофарм 2013 (GMP). Создана компании рынке ресурсы Анджей период рецепта современного доступны Компания препаратов вырос. Например, Затонский, Изменение миллион преимуществами мелоксикам рецептурных самого стала инновационных или В человек, год. Pharmacy"
}

requests[security] and the C tool chain

Hello!

Algolia has been super fun to learn and start working with.

I had one minor concern regarding the pinned dependency on requests[security].

We're using the client with AWS Lambda which makes C Dependencies a major pain in the butt.

Specifying the security extras on your package is an excellent idea, as it ensures that folks with older/out-of-date Python installations get a nice high quality TLS connection to your servers.

For folks running Modern Pythons™️ this is no longer necessary.

And unfortunately for folks running in AWS Lambda or other environments that make deploying pure python modules/dependencies easy, it's just a pain in the butt to add PyOpenSSL, cffi, and cyptography.

You could consider using PEP 508 Environment Markers to specify requests[security] for ancient Pythons, while letting folks running the good stuff skate away into the server less sunset :)

Refinements in search_disjunctive_faceting override params

In this method, the optional refinements param override the params. Meaning that if I want to add a facet filter, I have to put it in the refinements, which is not the case in all other APIs.
What should logically happen is that the refinements should only be appended to the regular params.

Finding cause of too big exception

I'm using django algolia, which calls this library and recreating an index I got this error: algoliasearch.helpers.AlgoliaException: Record at the position 464 is too big size=110956 bytes

I've been unable to find which record is causing the problem. Neither record id 464 nor the 464th record seem large.

It would be great if the exception could display some of the data that caused the problem to make it easier to track down.

save_synonym should use `forwardToReplicas` instead of `forwardToSlaves`

Following our internal renaming initiative, the save_synonym method should have a few minor adjustements. The REST API now accepts forwardToReplicas in addition to forwardToSlaves when adding synonyms. All the documentation is being updated so it mention forwardToReplicas.

The python client should send forwardToReplicas instead of forwardToSlaves. Internal variables could also be renamed.

requests expect timeout as a float instead of a tuple

Traceback (most recent call last):
  File "static_script_algolia_index.py", line 121, in <module>
    days=options.days)
  File "static_script_algolia_index.py", line 79, in main
    index.clear_index()
  File "/usr/local/lib/python2.7/dist-packages/algoliasearch/index.py", line 588, in clear_index
    return self._perform_request(self.write_hosts, '/clear', 'POST')
  File "/usr/local/lib/python2.7/dist-packages/algoliasearch/index.py", line 820, in _perform_request
    params=params, body=body, is_search=is_search)
  File "/usr/local/lib/python2.7/dist-packages/algoliasearch/client.py", line 499, in _perform_request
    params=params, data=body, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 316, in send
    timeout = TimeoutSauce(connect=timeout, read=timeout)
  File "/usr/lib/python2.7/dist-packages/urllib3/util.py", line 116, in __init__
    self._connect = self._validate_timeout(connect, 'connect')
  File "/usr/lib/python2.7/dist-packages/urllib3/util.py", line 147, in _validate_timeout
    "int or float." % (name, value))
ValueError: Timeout value connect was (1, 30), but it must be an int or float.

Decimals get encoded as strings during API calls

This causes issues in searching and faceting as some APIs (using vanilla REST API) send numbers, while other APIs (using algoliasearch client) send numbers as strings.

Edit: Never mind... I was planning to submit a PR with a change to JSON encoder that would output Decimals as JS floats. Albeit this might be desirable for my use case it would not work correctly for the general use case (where serializing to string is a better option IMO).

I am going to leave this issue open with the following request in mind... Since I am going to need to override client on my end - it would be greatly appreciated if Algolia client would give me an option to pass in my own JSON Encoder, this would greatly improve maintenance on my end.

I have already started work on a PR, but abandoned it as I have no idea what approach your team would find acceptable.

Unreachable Hosts

The new update 1.9.0 does not work properly. I get unreachable hosts error.

Read operations should use `is_search=True`

Index.search_rules does not specify is_search=True, which may potentially lead to targeting a different host than the one used for wait_task, and thus leading to inconsistent result (e.g. the wait task host says the task is published, but the host targeted by search_rules hasn't finished building it).

Note: Other methods may be impacted. => Let's review them. All read operations should use is_search=True.

use without models

Can i use Algolia without using models ? (I'am using only urls.py file for frontend side). Can I iterate somehow thru .html files or just scan every page in urls.py and then query the search using those results ?

Error on the delete_by_query method when Distinct > 1

In the case the distinct is enabled on an index (with distinct > 1), a call to the method delete_by_query returns the following error:

{
  "message": "invalid distinct value, hitsPerPage * distinct should be <= 1000",
  "status": 400
}

We should probably override distinct=false at query time when the method performs the search call.

Unit test fail

  • Clone the current repo (2015-10-20 @ 14:00 GMT - https://github.com/algolia/algoliasearch-client-python/tree/c50a710ad90d8d0257ab4693ffb8a9b69c10af06)

  • Setup the ALGOLIA_* environment variables

  • Setup virtualenv and run pip install -r requirements

  • Run nosetets

    [...]
    AlgoliaException: Unreachable hosts: {'8IOHDS4YN8-1.algolianet.com': 'Timeout 
    value connect was (1, 30), but it must be an int or float.', '8IOHDS4YN8
    3.algolianet.com': 'Timeout value connect was (5, 50), but it must be an int or 
    float.', '8IOHDS4YN8-2.algolianet.com': 'Timeout value connect was (3, 40), but 
    it must be an int or float.', '8IOHDS4YN8.algolia.net': 'Timeout value connect was 
    (1, 30), but it must be an int or float.'}
    
    ----------------------------------------------------------------------
    Ran 27 tests in 2.459s
    
    FAILED (errors=30)
    

The tests are OK with the following change in client.py, but I'm not sure that's the expected behaviour so I'm not submitying any patch here.

Replace

    for i, host in enumerate(hosts):
        if i > 1:
            if isinstance(timeout, tuple):
                timeout = (timeout[0] + 2, timeout[1] + 10)
                timeout = timeout[1] + 10
            else:
                timeout += 10

By

    for i, host in enumerate(hosts):
        timeout = timeout[1] + 10

cannot install algoliasearch on python3.4 ubuntu 14.04

basically on python3.4 installing pip dependencies from custom requirements.txt crash when it starts to install algolia, here is the trace:



Collecting Pillow==3.0.0 (from -r /home/iplay/app/requirements.txt (line 14))
  Using cached Pillow-3.0.0.tar.gz
Collecting pypandoc==1.1.2 (from -r /home/iplay/app/requirements.txt (line 15))
  Using cached pypandoc-1.1.2.zip
Collecting algoliasearch==1.7.1 (from -r /home/iplay/app/requirements.txt (line 16))
  Using cached algoliasearch-1.7.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-build-4mlicdah/algoliasearch/setup.py", line 17, in <module>
        import pypandoc
    ImportError: No module named 'pypandoc'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-4mlicdah/algoliasearch/setup.py", line 21, in <module>
        README = readme.read()
      File "/home/iplay/app/venv/lib/python3.4/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 23832: ordinal not in range(128)

    ----------------------------------------

:stderr: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4mlicdah/algoliasearch

possible way to avoid above crash is to install pypandoc before installing algolia, however it isn't case when we do automating deploy

[Question] Is partial_update_object working?

I am trying to implement the function partial_update_object without success. I can see the function is implemented in the library but is it working in your server? It is not updating my indexes.

Bad write retry error with python 2.7.10

When I try to execute

def test_network(self):
        batch = []
        for i in range(1, 3000):
            batch.append({'action': 'addObject', 'body': {
                'test1': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
            }})
        self.index.batch(batch)

I receive the error: AlgoliaException: Unreachable hosts: {'YLGNV73XLW-2.algolianet.com': "[('SSL routines', 'ssl3_write_pending', 'bad write retry')]", 'YLGNV73XLW.algolia.net': "[('SSL routines', 'ssl3_write_pending', 'bad write retry')]", 'YLGNV73XLW-3.algolianet.com': "[('SSL routines', 'ssl3_write_pending', 'bad write retry')]", 'YLGNV73XLW-1.algolianet.com': "[('SSL routines', 'ssl3_write_pending', 'bad write retry')]"}

If I use python 3.4, the issue is fixed, it's maybe related to https://hg.python.org/cpython/rev/60310223d075/

Feature : CLI

A cli would be nice so that we can work directly from terminal (e.g. set index settings ) .

browse_all cursor appears to end before all records are processed

Consider the following code:

records = index.browse_all()
ids = []
for r in records:
        ids.append(r['id'])
        print len(ids)
print 'hits', records.answer['nbHits']
print 'ids', len(ids)
print 'cursor', records.cursor

Output:

1
2
....
1020000
hits 1330369
ids 1020000
cursor

Why am I not able to iterate the final 310369 records?

Method names should be snake case

First, thanks for this library and awesome service!

http://legacy.python.org/dev/peps/pep-0008/#method-names-and-instance-variables

Function names should be lowercase, with words separated by underscores as necessary to improve readability.

mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.

Also see.

http://www.cs.kent.edu/~jmaletic/papers/ICPC2010-CamelCaseUnderScoreClouds.pdf

Most libraries in python use snake case. Seems odd to have camel case. Thanks for considering this.

atomic increment/decrements?

Is atomic increments and decrements possible using algolia's system?

Thanks for this lib btw..

The use case is many mobile users added to an index, and one of the fields in the object's scheme is followers, when an existing object comes in, I would like to add that input as a increment count on the followers_count field?

Is this cleanly possible either using the RESTapi or python lib or for that matter Android lib?

Thanks!

Occasional "Unreachable Host" error

AlgoliaException: Unreachable hosts: {'****-1.algolianet.com': "SSLError: hostname '****-1.algolianet.com' doesn't match either of '*.algolia.io', '*.algolia.net'", '****-3.algolianet.com': "SSLError: hostname '****-3.algolianet.com' doesn't match either of '*.algolia.io', '*.algolia.net'", '****-2.algolianet.com': "SSLError: hostname '****-2.algolianet.com' doesn't match either of '*.algolia.io', '*.algolia.net'", '****.algolia.net': "ReadTimeout: HTTPSConnectionPool(host='****.algolia.net', port=443): Read timed out. (read timeout=1)"}

How can I prevent this error from happening?

Let me know if there's any more information I can provide.

Unable to use generated secured API key in backend

I expected to be able to use a secured API key in the backend as well as the frontend. This doesn't appear to work:

This is failing for me:

from algoliasearch import algoliasearch

# generate the secured API key
client = algoliasearch.Client('', '')
secured_key = client.generate_secured_api_key('****', 'filters=...')

# Connect to algolia using the secured API key
client = algoliasearch.Client('****', secured_key)
index = client.init_index('testing')
index.add_object({'foo': 123})

This results in the exception: AlgoliaException: Invalid Application-ID or API key

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.