Skip to content

Add landing_getting_started_1 code samples #180

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

Merged
merged 2 commits into from
Apr 20, 2022
Merged

Add landing_getting_started_1 code samples #180

merged 2 commits into from
Apr 20, 2022

Conversation

brunoocasali
Copy link
Member

@brunoocasali brunoocasali commented Apr 14, 2022

Add a landing_getting_started_1 code sample to be on the new landing page block.

Closes: #174

@brunoocasali brunoocasali added the documentation Improvements or additions to documentation label Apr 14, 2022
@@ -0,0 +1,38 @@
landing_getting_started_1: |-
# Configure your entities by adding them in config/packages/meili_search.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

Since this file has two different languages, I must use markdown here, or the landing page will understand it?

CC: @bidoubiwa @mdubus

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey! It will not unfortunately :/ We have the same issue in angular. We settled for this with morgane: https://github.com/meilisearch/meilisearch-angular/blob/main/.code-samples.meilisearch.yaml

We are not sure how ugly it will look, when we now more we can potentially try things out.

#[Route('/add-movies', name: 'addMovies')]
public function addMovies(ManagerRegistry $doctrine): Response
{
$entityManager = $doctrine->getManager();
Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to just call the persistence and say this will be automatically indexed, but I don't know if this would be clear for symfony users. WDYT @curquiza & @gmourier ?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure to understand, for me you already said it will be automatically updated some line below right?

// Inserting data in your DB table will automatically update your Meilisearch index

Copy link
Member Author

@brunoocasali brunoocasali Apr 19, 2022

Choose a reason for hiding this comment

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

Yeah, but do you think the comment // Inserting data in your DB table will automatically update your Meilisearch index is necessary?

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any problem to have it on a sample code to remind this information. Will the content of this comment be mentioned before or after the sample code?

If not, it seems useful to me because there is a bit of magic with the ORM hooks here, it also helps someone who doesn't necessarily read the surrounding text and copy and paste the sample code directly.

Copy link
Member

Choose a reason for hiding this comment

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

It's ok from my POV to let it. We added it to Rails as well, and I agree with guillaume: it's a little bit magic and not obvious, from my POV

@brunoocasali
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Apr 20, 2022

@bors bors bot merged commit 35b6f4b into main Apr 20, 2022
@bors bors bot deleted the code-samples-update branch April 20, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update .code-samples.meilisearch.yaml
4 participants