vintasoftware / django-zombodb Goto Github PK
View Code? Open in Web Editor NEWEasy Django integration with Elasticsearch through ZomboDB Postgres Extension
Home Page: https://django-zombodb.readthedocs.io
License: MIT License
Easy Django integration with Elasticsearch through ZomboDB Postgres Extension
Home Page: https://django-zombodb.readthedocs.io
License: MIT License
https://github.com/zombodb/zombodb/blob/master/TYPE-MAPPING.md
Idea: an additional field for ZomboDBIndex.
Steps to reproduce:
django.db.utils.ProgrammingError: type "restaurants_name_016c1c_zombodb_row_type" already exists
For now, solution is to make a custom database backend engine, like https://github.com/SectorLabs/django-postgres-extra. Then, in the custom backend, implement something like SpatialiteSchemaEditor.delete_model.
We won't fix this now since we want an easier to configure API and this is a low impact issue.
When we generate migrations, the result is:
migrations.AddIndex(
model_name='xmodel',
index=django_zombodb.indexes.ZomboDBIndex(
fields=['name', 'slug'],
name='xmodel_slug_f88d55_zombodb',
url='http://127.0.0.1:9200/'
),
),
The value of url kwarg should be settings.ZOMBODB_ELASTICSEARCH_URL because on different environments we might have different ElasticSearch URLs. Running migrations in production or staging/qa, will fail because ES has a different URL.
This should be the correct output:
migrations.AddIndex(
model_name='xmodel',
index=django_zombodb.indexes.ZomboDBIndex(
fields=['name', 'slug'],
name='xmodel_slug_f88d55_zombodb',
url=settings.ZOMBODB_ELASTICSEARCH_URL
),
),
Say we filter the queryset as shown in the docs
Restaurant.objects.filter(
name__startswith='Pizza'
).query_string_search(
'name:Hut'
)
Is that a scalable solution? I suppose I'm asking whether:
relevance
which the normal filtered query is then ordered by) such that neither the search query size nor the index complexity increases with the number of things that you filter/exclude?I'm a bit more used to django-haystack, where in order to achieve this kind of filtering scalably you'd have to have a thing you want to filter against in the search index itself. Excited by the potential of zombodb but needed to check this!
Please could the documentation here include a slightly more in depth note about how those filters are achieved and if it's scalable?
Related to zombodb/zombodb#345
Related to #10 and zombodb/zombodb#335
On the dependency management part of the Makefile, remember to remove dependencies added to requirements.txt because of Django so you don't pin them as well.
sed '/django==/d' requirements.txt > requirements.tmp; mv requirements.tmp requirements.txt
sed '/# via django$$/d' requirements.txt > requirements.tmp; mv requirements.tmp requirements.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.