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/mobility data search #257

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from
Open

Conversation

juuso-j
Copy link

@juuso-j juuso-j commented Mar 22, 2023

Mobility data search


Breakdown:

Models

  1. mobility_data/migrations/0042_add_mobileunit_multilingual_search_columns.py
    • Adds multilingual search columns for storing lexems.
  2. mobility_data/migrations/0043_add_mobileunit_multilingual_content_type_names.py
    • Adds multilingual content_type_names columns for storing name of content types.
  3. mobility_data/migrations/0044_add_mobileunit_syllables_fi_column.py
    • Add syllables_fi column for storing syllables.
  4. mobility_data/migrations/0045_mobileunit_inherit_options_from_basemodel.py
    • Inherit options from base models meta class
  5. mobility_data/models/mobile_unit.py
    • Add search_columns, content_types_names and syllables fi. Make search columns GiN indexes. Add functions for getting searchable columns and columns for hyphenation.
  6. services/migrations/0095_add_mobility_data_mobileunit_to_search_view.py
    • Add model MobileUnit to search view

Management commands

  1. services/management/commands/index_search_columns.py
    • Add indexing and generation of syllables for mobile units. Return number of syllables generated.
  2. services/management/commands/empty_search_columns.py
    • Add model MobileUnit

API

  1. mobility_data/api/serializers/content_type.py
    • Add ContentTypeSerializerTrimmed serializer
  2. services/search/api.py
    • Search for mobile units in search view and serialize results for mobile units.

Tests

  1. services/search/tests/conftest.py
    • Add content_types and mobile_units fixtures
  2. services/search/tests/test_api.py
    • Test mobile unit search

Importers

  1. mobility_data/importers/utils.py
    • Add function to generate content_type_names. Populate search columns when saving mobility data.
  2. mobility_data/management/commands/import_mobility_data.py
    • Add parking machines

Other

  1. services/search/constants.py
    • Add list of models to hyphenate. Remove LENGTH_OF_HYPHENATED_WORDS
  2. services/search/specification.swagger.yaml
    • Add mobileunit to types
  3. services/search/utils.py
    • Hyphenate only compound words
  4. services/signals.py
    • Add on_save signal for model MobileUnit
  5. mobility_data/importers/data/content_types.yml

@juuso-j juuso-j added the enhancement New feature or request label Mar 22, 2023
@juuso-j juuso-j requested review from mhieta and ezkat March 22, 2023 13:16
@juuso-j juuso-j self-assigned this Mar 22, 2023
@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 86.92% and project coverage change: +0.31 🎉

Comparison is base (c1faeb7) 66.52% compared to head (b5069cb) 66.84%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #257      +/-   ##
===========================================
+ Coverage    66.52%   66.84%   +0.31%     
===========================================
  Files          216      216              
  Lines        12680    12792     +112     
  Branches      1627     1639      +12     
===========================================
+ Hits          8436     8551     +115     
+ Misses        3871     3867       -4     
- Partials       373      374       +1     
Impacted Files Coverage Δ
...rvices/management/commands/empty_search_columns.py 0.00% <0.00%> (ø)
...rvices/management/commands/index_search_columns.py 31.81% <25.00%> (+2.13%) ⬆️
services/search/api.py 72.79% <80.00%> (+4.24%) ⬆️
mobility_data/importers/utils.py 73.95% <81.25%> (+0.58%) ⬆️
mobility_data/models/mobile_unit.py 90.56% <91.66%> (+0.91%) ⬆️
mobility_data/api/serializers/content_type.py 100.00% <100.00%> (ø)
services/search/constants.py 100.00% <100.00%> (ø)
services/search/tests/conftest.py 100.00% <100.00%> (ø)
services/search/tests/test_api.py 100.00% <100.00%> (ø)
services/search/utils.py 69.79% <100.00%> (+3.85%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant