django-haystack / django-haystack/django-haystack

Issue __startswith

Open
#780 0 comments 0 reactions 0 assignees View on GitHub

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

Hello,

I have an issue using __startswith filter and ElasticSearch backend for the following search string with __startswith :

Req1. : "Paris 02"
Req2. : "Paris 0"

The first query returns a result whereas the second doesn't. Does anyone understand the magic behind the __startswith filter ? Normally a shorter equivalent search term should at least return the same amount of result, no ?

Thank you for your answer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two __startswith searches, "Paris 02" and "Paris 0", using the Elasticsearch backend and compare their results. Trace how the filter is translated for each query; done means the behavior is explained and the shorter prefix returns the expected matching results or the limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, python
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.