jorgecarleitao / django-sphinxql Goto Github PK
View Code? Open in Web Editor NEWSphinx search in Django
License: Other
Sphinx search in Django
License: Other
Currently we only support Python 3. Given that Django supports both, either we can try to support Python 2.7, or wait for Django to drop support on Python 2.7.
Omg, please help, I cannot understand how I can override settings for multiple models with multiple indexes, example of settings would be great, thank you!
I've just submitted this issue to Sphinx. Meanwhile, we have to cover this situation.
Hi!
My project and the Sphinx indices are on different servers. I set parameters for sphinx:
INDEXES = {
'searchd_params':{
'listen': 'example.com:9306:mysql41',
}
}
But when i try to search
MyModelIndex.objects.search("searchstring")
i get an error from sphinxql/configuration/connection.py , line 45
port = int(port_string.split(':')[0])
ValueError: invalid literal for int() with base 10: 'example.com'
Sphinx documentation says that the hostname can be found before the first delimiter ":", but not necessarily.
Please correct parameters parsing.
sphinx returns the indexed data from its covering indexes as you know, removing the need for a subsequent mysql call.
i've been able to use this functionality to do pagination via RawQuery but unfortunately the built in paginator isn't able to do limits/offsets or cache the RawQuerySet fetching the entire result for each page.
do you think you can add the functionality to do proper cached pagination with limits?
At the moment, installing the app as per documentation fails because the module indexes.py
is not loaded and thus the indexes are not registered.
One current fix to this is to import the indexes.py
by a module in the project.
Using Django 1.7 app config API may be the way to go here.
At least I faced with problem that in Django 1.10 removed add_aggregate func, I tryed replace by func add_annotation according to docs 1.8, but it raised another errror.Roll back to Django 1.9(
Hello! I use UUID as PK in my project. I used to solve this problem in self-written config:
sql_query = SELECT ('x' || translate("id"::text, '-', ''))::bit(64)::bigint AS "id", "id" AS "uid", "text" FROM "documents_document"
But django-sphinxql doesn't allow using such a solution. There are two problems:
Is there any way to solve my problem? I didn't find it.
If there no way to do this, I propose to:
_annotated_models
and _get_query
. Like this:indexes = OrderedDict([(index_obj.get_pk(), index_obj)
for index_obj in
self._sphinx_queryset[:self.max_search_count]])
This method can be overriden in Index subclass.
If you like this proposal, I will do the job and make pull request soon.
We also need to check if this also happens on the Sphinx side.
The readme file indicates INDEXES should contain:
'path': os.path.join(BASE_DIR, '_index'),
But the code is looking for it in caps, so like this:
'PATH': os.path.join(BASE_DIR, '_index'),
Sphinx indexes letters outside ascii as space separators. For instance, "Frühstück"
is indexed was three words "Fr hst ck"
, see Sphinx docs.
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.