notanumber/xapian-haystack — Issue #90: django_id filtering doesn't work.
Author: melinath
Created: 2012-01-31 22:50:26+00:00
State: open

I'm seeing the following behavior with the master branch of xapian-haystack, but none of the commits in 2.0.X seem targeted at fixing this issue. With the whoosh backend, I get what you would expect:

```python
>>> SearchQuerySet().filter(content="Introduction from the fake")
[]
>>> SearchQuerySet().filter(django_id=1)
[]
```

With the xapian backend, on the other hand:

```python
>>> SearchQuerySet().filter(content="Introduction from the fake")
[]
>>> SearchQuerySet().filter(django_id=1)
[]
```

I can work around this by adding an extra field which shadows django_id:

```python
class VideoIndex(indexes.SearchIndex):
pk_hack = indexes.IntegerField(model_attr='pk')
```