django-sphinx icon indicating copy to clipboard operation
django-sphinx copied to clipboard

Find record by non primary-key

Open oduvan opened this issue 14 years ago • 0 comments

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?

oduvan avatar May 05 '10 19:05 oduvan