django-elasticsearch | Django ElasticSearch Backend | REST library

 by   aparo Python Version: Current License: BSD-3-Clause

kandi X-RAY | django-elasticsearch Summary

kandi X-RAY | django-elasticsearch Summary

django-elasticsearch is a Python library typically used in Web Services, REST applications. django-elasticsearch has build file available, it has a Permissive License and it has low support. However django-elasticsearch has 1 bugs and it has 1 vulnerabilities. You can download it from GitHub.

Django ElasticSearch Backend
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              django-elasticsearch has a low active ecosystem.
              It has 142 star(s) with 30 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 2 have been closed. On average issues are closed in 661 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of django-elasticsearch is current.

            kandi-Quality Quality

              OutlinedDot
              django-elasticsearch has 1 bugs (1 blocker, 0 critical, 0 major, 0 minor) and 71 code smells.

            kandi-Security Security

              django-elasticsearch has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OutlinedDot
              django-elasticsearch code analysis shows 1 unresolved vulnerabilities (1 blocker, 0 critical, 0 major, 0 minor).
              There are 3 security hotspots that need review.

            kandi-License License

              django-elasticsearch is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              django-elasticsearch releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              django-elasticsearch saves you 693 person hours of effort in developing the same functionality from scratch.
              It has 1603 lines of code, 143 functions and 25 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed django-elasticsearch and discovered the below as its top functions. This is intended to give you an instant insight into django-elasticsearch implemented functionality, and help decide if they suit your requirements.
            • Return the database connection
            • Connect to Elasticsearch
            • Return a connection to the database
            Get all kandi verified functions for this library.

            django-elasticsearch Key Features

            No Key Features are available at this moment for django-elasticsearch.

            django-elasticsearch Examples and Code Snippets

            No Code Snippets are available at this moment for django-elasticsearch.

            Community Discussions

            QUESTION

            Error when running pip install -r requirements.txt
            Asked 2022-Mar-31 at 07:22

            to build and run a local instance, im following the tutorial at https://haha.readthedocs.io/en/latest/install.html but i use the git repo https://github.com/readthedocs/readthedocs.org.git instead of https://github.com/rtfd/readthedocs.org.git for the "git clone" command, as the link in the tutorial does not exist. i am also using venv, and not virtualenv, as i was not able to make virtualenv work.

            i then get to the step to run the following command

            ...

            ANSWER

            Answered 2022-Mar-31 at 07:21

            You are using python 3.10 which does not have a whl file available on PyPi for pywin32==227. Try the installation with a lower python version e.g. 3.9

            Source https://stackoverflow.com/questions/71687994

            QUESTION

            Connecting ElasticSearch to Django using "django-elasticsearch-dsl" results in ConnectionError when attempting to create/rebuild index
            Asked 2022-Feb-28 at 09:47

            I am trying to call a local ES instance running on docker. I used the following instructions to setup my ES instance: https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-dev-mode

            I am able to play around with my instance on Kibana at http://0.0.0.0:5601/app/dev_tools#/console. Everything works upto here.

            Now I am trying to define some sample documents using django models and index them through the library; I am following the instructions here: https://django-elasticsearch-dsl.readthedocs.io/en/latest/quickstart.html#install-and-configure

            First, I add pip installed and added django_elasticsearch_dsl to INSTALLED_APPS

            Next, I added in settings.py:

            ...

            ANSWER

            Answered 2022-Feb-28 at 09:47

            I figured that it was an issue with my certificate.

            I needed to add some additional config param to the ELASTICSEARCH_DSL variable. Adding this solves the issue:

            Source https://stackoverflow.com/questions/71281717

            QUESTION

            Django elasticsearch DSL with custom model fields (hashid field)
            Asked 2021-Aug-21 at 02:56

            I have a model that uses django hashid fields for the id.

            ...

            ANSWER

            Answered 2021-Aug-21 at 02:56

            For anyone interested, I managed to solve this by overriding the generate_id method of the Document so that the _id used is just a plain string:

            Source https://stackoverflow.com/questions/68821797

            QUESTION

            How to map keyword field in Django Elasticsearch?
            Asked 2021-May-12 at 12:23

            I am using django-elasticsearch-dsl library a high level client to interact with elasticsearch.

            This is my Document.py file

            ...

            ANSWER

            Answered 2021-May-12 at 12:21

            I figured out how to explicitly map keyword fields:

            In documents.py

            Source https://stackoverflow.com/questions/67433078

            QUESTION

            Django-Elasticsearch-DSL Nested Range Query
            Asked 2021-Feb-17 at 22:54

            I'm trying to implement the following Elasticsearch query using django-elasticsearch-dsl and am having some difficulty

            Query

            ...

            ANSWER

            Answered 2021-Feb-17 at 22:08

            As the author of elasticsearch-dsl-py says, you'll need to use nested filters. One option would be:

            Source https://stackoverflow.com/questions/66249266

            QUESTION

            Django elasticsearch dsl completion field issue
            Asked 2020-Nov-22 at 22:08

            I am trying to implement search suggestions using django-elasticsearch-dsl-drf for streets.

            This is documents.py:

            ...

            ANSWER

            Answered 2020-Nov-22 at 22:08

            It looks like you're using wrong endpoint for suggestions. Correct name is suggest.

            Example: http://127.0.0.1:8000/search/publishers/suggest/?country_suggest__completion=Ar

            Corresponding viewsets

            As of your question about using two fields for suggestion at once, it's possible to get suggestions for multiple fields at once. For instance, if you have title and author, both properly indexed and configured, you could query it as follows:

            http://127.0.0.1:8000/search/books/suggest/?title_suggest=wa&author_suggest=le

            This will, however, return you the following result:

            Source https://stackoverflow.com/questions/64918439

            QUESTION

            Django Elasticsearch dsl drf OR query
            Asked 2020-Oct-26 at 09:53

            How to make OR query (using django-elasticsearch-dsl-drf) with multiple contains statements? Query in words: Search for objects where title contains "hello" OR description contains "world"

            I can't find about it in documentation: https://django-elasticsearch-dsl-drf.readthedocs.io/en/0.3.12/advanced_usage_examples.html#usage-example

            ...

            ANSWER

            Answered 2020-Oct-26 at 09:53

            what you need is boolean query with should clause, its very easy to construct in JSON format, and validate the search results.

            For Django, although I am not familiar, this page of queries DSL and specifically this sub-section should fix your issue.

            Source https://stackoverflow.com/questions/64534716

            QUESTION

            NewConnectionError(: Failed to establish a new connection: [Errno 111] Connection refused)
            Asked 2020-Oct-18 at 13:03

            I am trying to build a simple django elastice search which can search cars. But when I am trying to rebuid the indexes, it gives me the error above. I am following this doc -> quickstart elasticsearch...full traceback is given below->

            ...

            ANSWER

            Answered 2020-Oct-18 at 13:03

            First of all make sure you have installed and configured ElasticSearch service properly (you can use this document).This error is saying that your code could not connect to ElasticSearch service with your current configs. Check if your elastic service is up and running. In Linux based OS you can check it by $ sudo systemctl status elasticsearch.service and in the result page you should see the line Active: active (running). After this step check the url http://localhost:9200/ (if you did not change the default settings) and if everything is OK you should see the following results:

            Source https://stackoverflow.com/questions/64412000

            QUESTION

            Django elasticsearch dsl term and phrase search is not working
            Asked 2020-Sep-22 at 12:45

            I used two packages (i.e. django-elasticsearch-dsl==7.1.4 and django-elasticsearch-dsl-drf==0.20.8) to add a search engine to my Django project. The model which I indexed in elastic is:

            ...

            ANSWER

            Answered 2020-Sep-22 at 12:45

            The problem was in my suggester configurations. First of all for term and phrase suggest we do not need completion fields (i.e. 'suggest': fields.CompletionField()) and we just need to declare our field in our Index, something like:

            Source https://stackoverflow.com/questions/63965538

            QUESTION

            Elasticsearch Indexing in Django Celery Task
            Asked 2020-Apr-24 at 15:56

            I’m building a Django web application to store documents and their associated metadata.

            The bulk of the metadata will be stored in the underlying MySQL database, with the OCR’d document text indexed in Elasticsearch to enable full-text search. I’ve incorporated django-elasticsearch-dsl to connect and synchronize my data models, as I’m also indexing (and thus, double-storing) a few other fields found in my models. I had considered using Haystack, but it lacks support for the latest Elasticsearch versions.

            When a document is uploaded via the applications’s admin interface, a post_save signal automatically triggers a Celery asynchronous background task to perform the OCR and will ultimately index the extracted text into Elasticsearch.

            Seeing as how I don’t have a full-text field defined in my model (and hope to avoid doing so as I don’t want to store or search against CLOB’s in the database), I’m seeking the best practice for updating my Elasticsearch documents from my tasks.py file. There doesn’t seem to be a way to do so using django-elasticseach-dsl (but maybe I’m wrong?) and so I’m wondering if I should either:

            1. Try to interface with Elasticsearch via REST using the sister django-elasticsearch-dsl-drf package.

            2. More loosely integrate my application with Elasticsearch by using the more vanilla elasticsearch-dsl-py package (based on elasticsearch-py). I‘d lose some “luxury” with this approach as I’d have to write a bit more integration code, at least if I want to wire up my models with signals.

            Is there a best practice? Or another approach I haven’t considered?

            Update 1: In trying to implement the answer from @Nielk, I'm able to persist the OCR'd text (result = "test" in tasks.py below) into ElasticSearch, but it's also persisting in the MySQL database. I'm still confused about how to essentially configure Submission.rawtext as a passthru to ElasticSearch.

            models.py:

            ...

            ANSWER

            Answered 2020-Apr-21 at 06:06

            You can add extra fields in the document definition linked to your model (see the field 'type_to_field' in the documentation https://django-elasticsearch-dsl.readthedocs.io/en/latest/fields.html#using-different-attributes-for-model-fields , and combine this with a 'prepare_xxx' method to initialize to an empty string if the instance is created, and to its current value in case of an update) Would that solve your problem ?

            Edit 1 - Here's what I meant:

            models.py

            Source https://stackoverflow.com/questions/61282288

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install django-elasticsearch

            You can download it from GitHub.
            You can use django-elasticsearch like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/aparo/django-elasticsearch.git

          • CLI

            gh repo clone aparo/django-elasticsearch

          • sshUrl

            git@github.com:aparo/django-elasticsearch.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link