Elasticsearch python autosuggest script - slow loading


#1

I'm building a simple autosuggest function as a standalone script (takes text as a URL parameter, returns JSON) using the very excellent elasticsearch-dsl python plugin.

Problem is, the import of the module slows the loading of the script:

from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search, Q

...making it untenable for use as a traditional CGI for autosuggest (because speed is obviously the key).

Can anyone think of an easy-ish way for me to make this stay in memory? Perhaps make a small web app with flask? I'm kind of looking for path-of-least-resistance here :wink:


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.