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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(form): add support for ChoiceType #88

Open
Guikingone opened this issue Jun 3, 2021 · 8 comments
Open

feat(form): add support for ChoiceType #88

Guikingone opened this issue Jun 3, 2021 · 8 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Guikingone
Copy link

Description
Hi everyone 馃憢馃徎

Is there any roadmap for a support of "search" in a form type?

What I mean by that is being able to create a custom form type that display a ChoiceType (or even in the SearchType) which use the Engine to display choices?

Thanks again for the feedback 馃檪

Basic example

Small example outside of this bundle: https://github.com/Guikingone/MeiliSearchBundle/blob/master/src/Form/Type/MeiliSearchChoiceType.php

@curquiza
Copy link
Member

curquiza commented Jun 3, 2021

Hello @Guikingone!
Nothing is planned for the moment, so every suggestion is appreciated 馃檪

I'm not a Symfony user, and no one is at Meili for the moment, so can you describe how the usage would change compared to the current one we have (cf our wiki)? Or is it just a feature addition?
How can we use it? 馃檪

@Guikingone
Copy link
Author

Hi @curquiza 馃憢馃徎

so can you describe how the usage would change compared to the current one we have (cf our wiki)? Or is it just a feature addition?

It's a feature addition

Advantages:

  • Use indexes and documents inside a form to display choices and speed search experience (when using SearchType)
  • Being able to create form that use MS without pain as a default type handle the configuration and results.
  • Allow to create a complete "search experience" without pain and a "deep" Symfony integration

Disadvantages:

  • Inject the SearchService into a type (which lead to a relation between the search experience and the Symfony architecture)
  • The error handling must be done in the type, so if MS fails, the form will too.

There might be some edge issues that I don't have in mind but IMHO, the feature could be interesting 馃檪

@curquiza
Copy link
Member

curquiza commented Jun 7, 2021

As I'm not a Symfony user I cannot tell if it's worth it to add it, I mean if the pros neutralize the cons! 馃檪

Maybe @codedge you have an opinion on it? 馃槆

Also, if someone around here is from the PHP/Symfony community and read this issue, feel free to comment and give your opinion.

@curquiza curquiza added the question Further information is requested label Jun 7, 2021
@94noni
Copy link
Contributor

94noni commented Jun 10, 2021

Hi, I recently began to use meilisearch (for now directly with the php lib) and for POC/basic usage
I plan to integrate it inside a symfony project and thus checked this lib

I think this symfony lib could indeed leverage this kind of code but not activated by default, and let ppl activate it if needed

Also, It could be great to have some others symfony components like messenger for async update, data collector to see the underlying MS requests, and maybe some views (twig/ux) logic to ease the frontend integration

Those are just ideas on the go :)
Cheers!

@Guikingone
Copy link
Author

@94noni I fully agree for both Messenger support and DataCollector support 馃殌

@codedge
Copy link
Contributor

codedge commented Jun 11, 2021

@Guikingone Anything that speaks against using your custom form type https://github.com/Guikingone/MeiliSearchBundle/blob/master/src/Form/Type/MeiliSearchChoiceType.php from being used here? I mean could you create a PR?

@Guikingone
Copy link
Author

Hi @codedge 馃憢馃徎

For now, I prefer to talk about this idea and see if the bundle can benefit from it, If there's a consensus about the feature, I could easily create the PR to see if it fit technically 馃檪

@curquiza
Copy link
Member

curquiza commented Jun 21, 2021

If you, as symfony users, think it's a good idea, let's start this! :)

@curquiza curquiza added the enhancement New feature or request label Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants