Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const searchClient = instantMeiliSearch(
"dc3fedaf922de8937fdea01f0a7d59557f1fd31832cb8440ce94231cfdde7f25",
{
hitsPerPage: 6, // default: 10
limitPerRequest: 30 // default: 50
limitPerRequest: 30, // default: 50
placeholderSearch: false // default: true. Displays documents even when the query is empty.
}
);
```
Expand Down
2 changes: 1 addition & 1 deletion examples/express/tests/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Instant MeiliSearch Browser test', () => {

it('Should have generated a instant-meiisearch client and displayed', async () => {
await expect(page).toMatch(
'{"client":{"cancelTokenSource":{"token":{"promise":{}}},"config":{"host":"http://localhost:7700","apiKey":"masterKey"}},"hitsPerPage":10,"limitPerRequest":50,"attributesToHighlight":["*"]}'
'{"client":{"cancelTokenSource":{"token":{"promise":{}}},"config":{"host":"http://localhost:7700","apiKey":"masterKey"}},"hitsPerPage":10,"limitPerRequest":50,"attributesToHighlight":["*"],"placeholderSearch":true}'
)
})
})
8 changes: 6 additions & 2 deletions playgrounds/vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</template>
</ais-hits>

<ais-pagination/>
<ais-pagination :padding="4" />
</div>
</ais-instant-search>
</div>
Expand All @@ -56,7 +56,11 @@ export default {
return {
searchClient: instantMeiliSearch(
"https://demos.meilisearch.com",
"dc3fedaf922de8937fdea01f0a7d59557f1fd31832cb8440ce94231cfdde7f25"
"dc3fedaf922de8937fdea01f0a7d59557f1fd31832cb8440ce94231cfdde7f25",
{
hitsPerPage: 6,
limitPerRequest: 100
}
)
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ export default function instantMeiliSearch(hostUrl, apiKey, options = {}) {
hitsPerPage: options.hitsPerPage || 10,
limitPerRequest: options.limitPerRequest || 50,
attributesToHighlight: ['*'],
placeholderSearch: options.placeholderSearch !== false, // true by default

transformToMeiliSearchParams: function (params) {
const searchInput = {
q: params.query,
q: this.placeholderSearch && params.query === '' ? null : params.query,
facetsDistribution: params.facets.length ? params.facets : undefined,
facetFilters: params.facetFilters,
attributesToHighlight: this.attributesToHighlight,
Expand Down