django-sphinx
django-sphinx copied to clipboard
Find record by non primary-key
I'm create model, which have CharField as PrimaryKey.
And on final stage of project I try to add SpinxSearch by this model. And Sphinx doesn't support non integer document id.
So, I add IntegerField to this model, and try to use it as document id.
After my changes in conf-file of sphinx I get
Painter.search.query('bern') - return 1 len(list(Painter.search.query('bern'))) - return 0
It's happen, because django-sphinx always use primary key for document id.
If I'm right, I can try to make patch, I which you can use parameter in SphinxSearch, for example document_id_field, which by default will be 'pk', but user can use any field.
What do you think about it?