Git Product home page Git Product logo

django-sphinxql's People

Contributors

jorgecarleitao 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

Watchers

 avatar  avatar  avatar  avatar

django-sphinxql's Issues

Add support to Python 2.7?

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.

Multiple indexes for models

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!

Incorrect parsing of listen settings

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.

Add pagination support?

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?

indexes not found if `indexes.py` not imported

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.

Doesn't work on Django 1.10

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(

Non-integer PK problem

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:

  1. It generates sql_query from Django queryset, so I can't redefine "id" field and cast it to integer in this way.
  2. It matches Sphinx id to DB id.

Is there any way to solve my problem? I didn't find it.

If there no way to do this, I propose to:

  1. Add "sql_query" option to "source_params". If "sql_query" is present, "query" attribute is ignored.
  2. Add method "get_pk" to Index. It will be used in _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.

Settings capitalization

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'),

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.