-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sweep: Modify di_website/publications/mixins.py or di_website/publications/models.py so stories.search(search_filter) only matches whole words #1339
Comments
Here's the PR! #1341.⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 5 GPT-4 tickets left. For more GPT-4 tickets, visit our payment portal.To get Sweep to recreate this ticket, leave a comment prefixed with "sweep:" or edit the issue.
Step 1: 🔍 Code SearchI found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.DIwebsite-redesign/di_website/publications/mixins.py Lines 1 to 262 in d1208ec
DIwebsite-redesign/di_website/publications/models.py Lines 1 to 1174 in d1208ec
DIwebsite-redesign/di_website/common/management/commands/importwp.py Lines 77 to 213 in d1208ec
DIwebsite-redesign/di_website/common/management/commands/importwp.py Lines 152 to 226 in d1208ec
DIwebsite-redesign/di_website/datasection/models.py Lines 351 to 461 in d1208ec
Summaries of links found in the content:https://github.com/devinit/DIwebsite-redesign/blob/develop/di_website/publications/models.py: The page does not contain any content or code snippets relevant to the problem. https://github.com/devinit/DIwebsite-redesign/blob/develop/di_website/publications/mixins.py: The page does not contain any content or code snippets relevant to the problem. Step 2: 🧐 Snippet AnalysisFrom looking through the relevant snippets, I decided to make the following modifications:
Step 3: 📝 PlanningI have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request: Fix search to only match whole words
Step 4: ⌨️ CodingI have finished coding the issue. I am now reviewing it for completeness. Step 5: 🔁 Code ReviewSuccess! 🚀 To recreate the pull request, leave a comment prefixed with "sweep:" or edit the issue. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Modify di_website/publications/mixins.py or di_website/publications/models.py so stories.search(search_filter) only matches whole words. ElasticSearch is interpreting this line https://github.com/devinit/DIwebsite-redesign/blob/develop/di_website/publications/mixins.py such that a
search_filter
variable here https://github.com/devinit/DIwebsite-redesign/blob/develop/di_website/publications/models.py is returning matches for "disbursement" when thesearch_filter
is equal to "disability." The code should be modified such that asearch_filter
equal to "disability" only returns results for closely related words like "disabilities."The search is using ElasticSearch, so it's possible the solution may involve passing
es_extra
dict to theindex.SearchField
to change an argument like theanalyzer.
The text was updated successfully, but these errors were encountered: