ymcatwincities / openy_activity_finder

Activity Finder for Open Y
https://github.com/YCloudYUSA/yusaopeny_activity_finder
GNU General Public License v3.0
3 stars 24 forks source link

Change ages indexation approach #133

Open duozersk opened 2 years ago

duozersk commented 2 years ago

Currently we are indexing from min age to max age with the 6 months steps.

https://github.com/ymcatwincities/openy_activity_finder/blob/4.x/src/Plugin/search_api/processor/AgesMinMax.php#L67

It has several flaws:

podarok commented 2 years ago

@KylieAldridge for the Jira

shelleygoetz commented 2 years ago

Jira ticket: https://openy.atlassian.net/browse/PRODDEV-515

podarok commented 2 years ago

merged, this one should be fixed now

@duozersk is there any test we can use for QA?

duozersk commented 2 years ago

Well... testing it is quite cumbersome.

We should have the session/activity (either in demo content or create manually) with the min age set to smth that is not dividable by 6 (in months). Like from min age 15 months to max age 36 months. The code before the fix would index 15, 21, 27 and 33 months into the search index for this activity and this session wouldn't be there in the results for any of the age filters (as the ages configuration doesn't have these numbers). The new version of code would index 18, 24 and 36 months - based on the ages configuration - and the activity will be there in the results in you select appropriate age filter.

Ages configuration is this one - https://github.com/ymcatwincities/openy_activity_finder/blob/4.x/config/install/openy_activity_finder.settings.yml#L4

froboy commented 2 years ago

I installed openy_prgf_af4_demo on 4.0.9 and got this error right off the bat:

Drupal\search_api_solr\SearchApiSolrException: Facets having a mincount of "0" is not yet supported by Solr for point based field types. Consider converting the following field to a string or index it twice as string: field_session_min_age. in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->setFacets() (line 3552 of modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php).

Once I updated to 4.x-dev the issue was resolved and the error gone. I think we should be good to tag a new release with this fix since AF4 on 4.0.9 seems broken.

podarok commented 2 years ago

Yes, we need to tag a new release @froboy It's war slowed down me a bit.