django-haystack / django-haystack/django-haystack
AutoQuery with spaces causes exception in ElasticSearch?
Open
Nobody has claimed this yet.
needs review
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 1.3k
- Avg merge
- 3h 18m
- Merged PRs (30d)
- 3
Description
# This works:
sqs = sqs.filter(SQ(text=AutoQuery('')))
# This fails with exception ElasticHttpError
sqs = sqs.filter(SQ(text=AutoQuery(' ')))
I noticed if I put in spaces for AutoQuery ElasticSearch throws an exception, is this normal behavior? I couldn't find a solution in the docs or anything so I just have been .strip'ing my strings.
Thanks for any help!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two AutoQuery examples from the issue, then trace how whitespace-only input is handled in the AutoQuery-to-Elasticsearch query path. Check the resulting exception and existing coverage, if any; done means whitespace input no longer raises unexpectedly or the behavior is documented as intentional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, python
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100