Skip to content

Commit 6107e03

Browse files
meili-bors[bot]nicolasvienotbidoubiwa
authored
Merge #407
407: Update wording from `MeiliSearch` to `Meilisearch` r=bidoubiwa a=nicolasvienot # Pull Request ## What does this PR do? Fixes # `@bidoubiwa` Feel free to create an issue if needed Update wording from `MeiliSearch` to `Meilisearch` I omitted the example on `How to use meilisearch-js` in `README.md` and the `meilisearch-js` import in `client.js` and `meilisearch.test.js` as we need to import `MeiliSearch` from this lib. <!-- Please link the issue you're trying to fix with this PR, if none then please create an issue first. --> Co-authored-by: nicolasvienot <[email protected]> Co-authored-by: cvermand <[email protected]>
2 parents cade9df + e07fbba commit 6107e03

File tree

11 files changed

+34
-34
lines changed

11 files changed

+34
-34
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If applicable, add screenshots or logs to help explain your problem.
2222

2323
**Environment (please complete the following information):**
2424
- OS: [e.g. Debian GNU/Linux]
25-
- MeiliSearch version: [e.g. v.0.20.0]
25+
- Meilisearch version: [e.g. v.0.20.0]
2626
- strapi-plugin-meilisearch version: [e.g v0.3.1]
2727
- Browser: [e.g. Chrome version 90.0]
2828
- Strapi version: [e.g. v3.6.2]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ module.exports = {
313313
meilisearch: {
314314
config: {
315315
restaurant: {
316-
filterEntry({ entry }) { // can also be async
316+
filterEntry({ entry }) { // can also be async
317317
return entry.title !== `Alfredo`
318318
},
319319
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "strapi-plugin-meilisearch",
33
"version": "0.6.4",
4-
"description": "Synchronise and search in your Strapi content-types with MeiliSearch",
4+
"description": "Synchronise and search in your Strapi content-types with Meilisearch",
55
"scripts": {
66
"playground:dev": "yarn --cwd ./playground && yarn --cwd ./playground develop",
77
"playground:build": "yarn --cwd ./playground && yarn --cwd ./playground build",
@@ -13,7 +13,7 @@
1313
"strapi": {
1414
"name": "meilisearch",
1515
"icon": "search",
16-
"description": "Search in your content-types with the MeiliSearch plugin",
16+
"description": "Search in your content-types with the Meilisearch plugin",
1717
"kind": "plugin"
1818
},
1919
"files": [

resources/meilisearch-settings/make-relationship-filterable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Imagine if you have a content-type restaurant with a categories field.
33
* Category is a content-type of its own. They have a many-to-many relationship.
44
*
5-
* In MeiliSearch you can use filters to for example in our case, only find italian restaurants.
5+
* In Meilisearch you can use filters to for example in our case, only find italian restaurants.
66
* To be able to do that, you need to provide a list of values and add in the settings the field in `filterableAttributes`.
77
* See guide: https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html#configuring-filters
88
*
@@ -17,7 +17,7 @@
1717
* ]
1818
* }
1919
*
20-
* Since MeiliSearch is expecting `category: ["Italian", "french"]` and
20+
* Since Meilisearch is expecting `category: ["Italian", "french"]` and
2121
* also `category` to be in `filterableAttributes` we can use the model configuration file to provide all these informations.
2222
*/
2323

server/__tests__/configuration-validation.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('Test plugin configuration', () => {
2222
expect(fakeStrapi.log.warn).toHaveBeenCalledTimes(0)
2323
expect(fakeStrapi.log.error).toHaveBeenCalledTimes(1)
2424
expect(fakeStrapi.log.error).toHaveBeenCalledWith(
25-
'The `config` field in the MeiliSearch plugin configuration must be of type object'
25+
'The `config` field in the Meilisearch plugin configuration must be of type object'
2626
)
2727
})
2828

@@ -58,7 +58,7 @@ describe('Test plugin configuration', () => {
5858
expect(fakeStrapi.log.warn).toHaveBeenCalledTimes(0)
5959
expect(fakeStrapi.log.error).toHaveBeenCalledTimes(1)
6060
expect(fakeStrapi.log.error).toHaveBeenCalledWith(
61-
'`host` should be a non-empty string in MeiliSearch configuration'
61+
'`host` should be a non-empty string in Meilisearch configuration'
6262
)
6363
})
6464

@@ -85,7 +85,7 @@ describe('Test plugin configuration', () => {
8585
expect(fakeStrapi.log.warn).toHaveBeenCalledTimes(0)
8686
expect(fakeStrapi.log.error).toHaveBeenCalledTimes(1)
8787
expect(fakeStrapi.log.error).toHaveBeenCalledWith(
88-
'`apiKey` should be a string in MeiliSearch configuration'
88+
'`apiKey` should be a string in Meilisearch configuration'
8989
)
9090
})
9191

server/__tests__/meilisearch.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const createMeilisearchService = require('../services/meilisearch')
22

33
const { createFakeStrapi } = require('./utils/fakes')
4-
const { MeiliSearch } = require('meilisearch')
4+
const { MeiliSearch: Meilisearch } = require('meilisearch')
55

66
jest.mock('meilisearch')
77

@@ -38,7 +38,7 @@ const mockIndex = jest.fn(() => ({
3838
}))
3939

4040
// @ts-ignore
41-
MeiliSearch.mockImplementation(() => {
41+
Meilisearch.mockImplementation(() => {
4242
return {
4343
getIndexes,
4444
index: mockIndex,

server/configuration-validation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function validateConfiguration(config) {
1313

1414
if (!isObject(config)) {
1515
strapi.log.error(
16-
'The `config` field in the MeiliSearch plugin configuration must be of type object'
16+
'The `config` field in the Meilisearch plugin configuration must be of type object'
1717
)
1818
config = {}
1919
}
@@ -22,14 +22,14 @@ function validateConfiguration(config) {
2222
// Validate the `host` parameter
2323
if ((host !== undefined && typeof host !== 'string') || config.host === '') {
2424
strapi.log.error(
25-
'`host` should be a non-empty string in MeiliSearch configuration'
25+
'`host` should be a non-empty string in Meilisearch configuration'
2626
)
2727
delete config.host
2828
}
2929

3030
// Validate the `apikey` parameter
3131
if (apiKey !== undefined && typeof apiKey !== 'string') {
32-
strapi.log.error('`apiKey` should be a string in MeiliSearch configuration')
32+
strapi.log.error('`apiKey` should be a string in Meilisearch configuration')
3333
delete config.apiKey
3434
}
3535

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict'
2-
const { MeiliSearch } = require('meilisearch')
2+
const { MeiliSearch: Meilisearch } = require('meilisearch')
33

44
/**
5-
* Create a MeiliSearch client instance.
5+
* Create a Meilisearch client instance.
66
*
77
* @param {object} config - Information to pass to the constructor.
88
*
9-
* @returns { object } - MeiliSearch client instance.
9+
* @returns { object } - Meilisearch client instance.
1010
*/
11-
module.exports = config => new MeiliSearch(config)
11+
module.exports = config => new Meilisearch(config)

server/services/meilisearch/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = ({ strapi }) => {
3535
},
3636

3737
/**
38-
* Transform contentTypes entries before indexation in MeiliSearch.
38+
* Transform contentTypes entries before indexation in Meilisearch.
3939
*
4040
* @param {object} options
4141
* @param {string} options.contentType - ContentType name.
@@ -76,7 +76,7 @@ module.exports = ({ strapi }) => {
7676
},
7777

7878
/**
79-
* Filter contentTypes entries before indexation in MeiliSearch.
79+
* Filter contentTypes entries before indexation in Meilisearch.
8080
*
8181
* @param {object} options
8282
* @param {string} options.contentType - ContentType name.
@@ -119,15 +119,15 @@ module.exports = ({ strapi }) => {
119119
},
120120

121121
/**
122-
* Returns MeiliSearch index settings from model definition.
122+
* Returns Meilisearch index settings from model definition.
123123
*
124124
* @param {object} options
125125
* @param {string} options.contentType - ContentType name.
126126
* @param {Array<Object>} [options.entries] - The data to convert. Conversion will use
127127
128128
* @typedef Settings
129129
* @type {import('meilisearch').Settings}
130-
* @return {Settings} - MeiliSearch index settings
130+
* @return {Settings} - Meilisearch index settings
131131
*/
132132
getSettings: function ({ contentType }) {
133133
const collection = contentTypeService.getCollectionName({ contentType })

server/services/meilisearch/connector.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
const MeiliSearch = require('./client')
2+
const Meilisearch = require('./client')
33

44
/**
55
* Add one entry from a contentType to its index in Meilisearch.
@@ -62,7 +62,7 @@ module.exports = ({ strapi, adapter, config }) => {
6262
getIndexes: async function () {
6363
try {
6464
const { apiKey, host } = await store.getCredentials()
65-
const client = MeiliSearch({ apiKey, host })
65+
const client = Meilisearch({ apiKey, host })
6666
const indexes = await client.getIndexes()
6767
return indexes
6868
} catch (e) {
@@ -82,7 +82,7 @@ module.exports = ({ strapi, adapter, config }) => {
8282
*/
8383
deleteEntriesFromMeiliSearch: async function ({ contentType, entriesId }) {
8484
const { apiKey, host } = await store.getCredentials()
85-
const client = MeiliSearch({ apiKey, host })
85+
const client = Meilisearch({ apiKey, host })
8686

8787
const indexUid = config.getIndexNameOfContentType({ contentType })
8888
const documentsIds = entriesId.map(entryId =>
@@ -103,7 +103,7 @@ module.exports = ({ strapi, adapter, config }) => {
103103
*/
104104
updateEntriesInMeilisearch: async function ({ contentType, entries }) {
105105
const { apiKey, host } = await store.getCredentials()
106-
const client = MeiliSearch({ apiKey, host })
106+
const client = Meilisearch({ apiKey, host })
107107

108108
if (!Array.isArray(entries)) entries = [entries]
109109

@@ -139,7 +139,7 @@ module.exports = ({ strapi, adapter, config }) => {
139139
getStats: async function ({ indexUid }) {
140140
try {
141141
const { apiKey, host } = await store.getCredentials()
142-
const client = MeiliSearch({ apiKey, host })
142+
const client = Meilisearch({ apiKey, host })
143143
return await client.index(indexUid).getStats()
144144
} catch (e) {
145145
return {
@@ -232,7 +232,7 @@ module.exports = ({ strapi, adapter, config }) => {
232232
*/
233233
addEntriesToMeilisearch: async function ({ contentType, entries }) {
234234
const { apiKey, host } = await store.getCredentials()
235-
const client = MeiliSearch({ apiKey, host })
235+
const client = Meilisearch({ apiKey, host })
236236

237237
if (!Array.isArray(entries)) entries = [entries]
238238

@@ -260,7 +260,7 @@ module.exports = ({ strapi, adapter, config }) => {
260260
*/
261261
addContentTypeInMeiliSearch: async function ({ contentType }) {
262262
const { apiKey, host } = await store.getCredentials()
263-
const client = MeiliSearch({ apiKey, host })
263+
const client = Meilisearch({ apiKey, host })
264264
const indexUid = config.getIndexNameOfContentType({ contentType })
265265

266266
// Get Meilisearch Index settings from model
@@ -347,7 +347,7 @@ module.exports = ({ strapi, adapter, config }) => {
347347
})
348348
} else {
349349
const { apiKey, host } = await store.getCredentials()
350-
const client = MeiliSearch({ apiKey, host })
350+
const client = Meilisearch({ apiKey, host })
351351

352352
const indexUid = config.getIndexNameOfContentType({ contentType })
353353
await client.index(indexUid).delete()

0 commit comments

Comments
 (0)