-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow multi indexing #85
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bidoubiwa
suggested changes
Dec 7, 2021
96b0a1d
to
caf52c9
Compare
caf52c9
to
e77a8a6
Compare
bidoubiwa
approved these changes
Dec 7, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥 🔥 🔥
bors merge |
bors bot
added a commit
that referenced
this pull request
Dec 7, 2021
85: Allow multi indexing r=mdubus a=mdubus # Pull Request ## What does this PR do? Closes #15 ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? ## What's inside this PR ? - Renaming of the field `queries` into `indexes` - The `indexes` field is now an array and allows us to provide multiple indexes and queries for indexation - Separation of the `validatePluginOptions` in 2 functions : `validatePluginOptions` for the global plugin options, and `validateIndexOptions` for the validation of each indexes options - Update of the playground plugin config to pass the `indexes` as an array - Update of each tests name for better understanding of what it should do - Update of the tests with the new naming (`indexes`) + addition of a new test testing the multi-indexation ## How to test ? - `yarn test` - `yarn playground:dev` and update the `playground/gatsby-config.js` by adding a second index (see example below). By going to your MeiliSearch's mini-dashboard (http://127.0.0.1:7700/ for me), you should see that the 2 indexes were created. You can also edit the `INDEX_NAME` inside `playground/src/pages/index.js` and see the changes on http://localhost:9000/ Example of second index : ```js { indexUid: 'index2', transformer: data => data.allMdx.edges.map(({ node }) => node), query: ` query MyQuery { allMdx { edges { node { id } } } } `, }, ``` Co-authored-by: Morgane Dubus <morgane.d@meilisearch.com>
bors merge |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
What does this PR do?
Closes #15
PR checklist
Please check if your PR fulfills the following requirements:
What's inside this PR ?
queries
intoindexes
indexes
field is now an array and allows us to provide multiple indexes and queries for indexationvalidatePluginOptions
in 2 functions :validatePluginOptions
for the global plugin options, andvalidateIndexOptions
for the validation of each indexes optionsindexes
as an arrayindexes
) + addition of a new test testing the multi-indexationHow to test ?
yarn test
yarn playground:dev
and update theplayground/gatsby-config.js
by adding a second index (see example below). By going to your MeiliSearch's mini-dashboard (http://127.0.0.1:7700/ for me), you should see that the 2 indexes were created. You can also edit theINDEX_NAME
insideplayground/src/pages/index.js
and see the changes on http://localhost:9000/Example of second index :