Skip to content
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

Feature/search hyphenate addresses #354

Merged
merged 20 commits into from
Jun 11, 2024
Merged

Conversation

juuso-j
Copy link

@juuso-j juuso-j commented May 16, 2024

Hyphenate addresses

Description

Also add feature to exclude words from search due to performance issues.

Trello #75


Breakdown:

Requirements

  1. requirements.in
  2. requirements.txt
    • Bump django-munigeo from v0.2.76 to v0.2.83.

Search

  1. services/fixtures/exclusion_words.json
    • Fixture of words to be excluded in search.
  2. services/migrations/0101_exclusionword.py
  3. services/models/init.py
  4. services/models/search_rule.py
    • Add model for storing the words for exclusion.
  5. services/search/api.py
    • Return bad request and message if exclusion word found in search query.
  6. services/search/utils.py
    • Add function that checks if exclusion word is in search query and function that gets attr recursively by following foreign key relations.

Indexing

  1. services/management/commands/index_search_columns.py
    • Hyphenate Finnish addresses and add parameters to choose the addresses for hyphenation by addresses modified_at timestamp.
  2. services/search/constants.py
    • Add constant HYPHENATE_ADDRESSES_MODIFIED_WITHIN_DAYS.
  3. smbackend_turku/tasks.py
    • Add args to task that indexes search columns

Tests

  1. services/search/tests/conftest.py
    • Add address fixture Kellonsoittajankatu and hyphenate addresses.
  2. services/search/tests/test_api.py
    • Test excluded words and hyphenated addresses.

@juuso-j juuso-j added enhancement New feature or request dependencies Pull requests that update a dependency file labels May 16, 2024
@juuso-j juuso-j requested review from mhieta and ezkat May 16, 2024 06:37
@juuso-j juuso-j self-assigned this May 16, 2024
Copy link
Collaborator

@mhieta mhieta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@juuso-j juuso-j merged commit b9d8536 into develop Jun 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants