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

feat: Responsive Filtering Implementation #72

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Cephaz
Copy link

@Cephaz Cephaz commented Jan 5, 2024

Related to #3

Target :

  • Filter by year
  • Filter by keynotes (How is it represented in a database?)
  • Filter by conference name (using event_id for the moment)

Commits :

  • Updated Meilisearch to consider event_id and year
  • Integrated Stimulus and form for responsive filtering with Tailwind
  • Added filter parameters [years] [event_ids]
  • update 0.10.2 meilisearch-rails
  • sort by date
  • click out side filter
  • add search endpoint and turbo_frame

To fix in progress:

Some problems on the dev : the reindex! doesn't seem to update the model Talk

Talk.index.settings // verify settings
client = MeiliSearch::Client.new('http://localhost:7700', <KEY>)
client.index('Talk').update_settings({
  searchable_attributes: ["title", "description", "speaker_names", "year", "event_name"],
  sortable_attributes: ["title", "date"],
  filterable_attributes: ["year", "event_id"],
})

Please do not hesitate to send us your feedback.

- Updated Meilisearch to consider event_id and year
- Integrated Stimulus and form for responsive filtering with Tailwind
- Added filter parameters in the Meilisearch controller
@adrienpoly
Copy link
Owner

Thanks @Cephaz for this draft I am on the road will look at it a bit later. About the keynote it is my mistake I thought I had added the attributes on the talk model but that is not the case yet

don’t worry about it

- fix filter icon positioning
- add sync mobile web screen check_box
- add default sort year desc
- create partial html for turbo_frame
@Cephaz
Copy link
Author

Cephaz commented Jan 8, 2024

[LOCAL DEMO]

Screen.Recording.2024-01-08.at.2.41.31.mp4

@adrienpoly
Copy link
Owner

Hello

This is looking promissing!

I tried the PR locally but getting this error for every search.

CleanShot 2024-01-08 at 17 18 08@2x

I tried Talk.clear_index! and Talk.reindex! but still getting the same error

do you have an idea?

@Cephaz
Copy link
Author

Cephaz commented Jan 8, 2024

there's a problem with meilisearch, I'll make a more detailed ticket

rails c
Talk.reindex! // not working for updating settings
Talk.index.settings // check actual settings
client = MeiliSearch::Client.new('http://localhost:7700', <KEY>) //connection client
client.index('Talk').update_settings({
  searchable_attributes: ["title", "description", "speaker_names", "year", "event_name"],
  sortable_attributes: ["title", "date"],
  filterable_attributes: ["year", "event_id"],
}) //update settings

@Cephaz
Copy link
Author

Cephaz commented Jan 8, 2024

curl -H "Authorization: Bearer <KEY>" http://localhost:7700/tasks/<id>

by default on a project init with in reindex! there are only 3 ids that are generated 0, 1 ,2
but settingsUpdate doesn't work for me (it's just to check if it's not enqueue)

{"uid":0,"indexUid":"Talk","status":"succeeded","type":"indexCreation","canceledBy":null,"details":{"primaryKey":"id"},"error":null,"duration":"PT0.017674332S","enqueuedAt":"2024-01-05T14:25:37.630392882Z","startedAt":"2024-01-05T14:25:37.637012087Z","finishedAt":"2024-01-05T14:25:37.654686419Z"}

{"uid":1,"indexUid":"Talk","status":"succeeded","type":"settingsUpdate","canceledBy":null,"details":{},"error":null,"duration":"PT0.004740782S","enqueuedAt":"2024-01-05T14:25:37.647437198Z","startedAt":"2024-01-05T14:25:37.656546468Z","finishedAt":"2024-01-05T14:25:37.66128725Z"}

{"uid":2,"indexUid":"Talk","status":"succeeded","type":"documentAdditionOrUpdate","canceledBy":null,"details":{"receivedDocuments":820,"indexedDocuments":820},"error":null,"duration":"PT0.451346560S","enqueuedAt":"2024-01-05T14:25:37.928852886Z","startedAt":"2024-01-05T14:25:37.934841086Z","finishedAt":"2024-01-05T14:25:38.386187646Z"}

https://www.meilisearch.com/docs/reference/api/tasks#get-tasks

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

Successfully merging this pull request may close these issues.

None yet

2 participants