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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new search parameters highlightPreTag, highlightPostTag and cropM… #318

Merged
merged 3 commits into from
May 4, 2022

Conversation

alallema
Copy link
Contributor

As per meilisearch/meilisearch#2214 new search parameters are introduced:

  • highlightPreTag
  • highlightPostTag
  • cropMarker

tests/Endpoints/SearchTest.php Outdated Show resolved Hide resolved
tests/Endpoints/SearchTest.php Outdated Show resolved Hide resolved
tests/Endpoints/SearchTest.php Show resolved Hide resolved
tests/Endpoints/SearchTest.php Show resolved Hide resolved
@alallema alallema requested a review from bidoubiwa April 25, 2022 14:32
'cropLength' => 2,
]);

$this->assertArrayHasKey('_formatted', $response->getHit(0));
Copy link
Member

Choose a reason for hiding this comment

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

Why here did you use $response->getHit(0) and in the assertion below you opted to use $response['hits'][0]

Copy link
Contributor Author

@alallema alallema May 2, 2022

Choose a reason for hiding this comment

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

I use $response['hits'] on the result of the rawSearch function who returns array instead of SearchResult. The getter can be called on an array:
See here the rawSearch function

Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer getters! Maybe it is worth creating an issue to change this consistently throughout the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rawSearch is here to access your specific fields in results I find it really useful, I used it in tests when I need to check the exact field of it. Don't think it's not consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we can create a specific class for the movies result or the books result in test

Copy link
Member

Choose a reason for hiding this comment

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

I see, but is there any specific reason to use the raw result?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rawResult gives me access to the subfields of _formatted because it is an array.I used it for check the cropMarker

@alallema alallema added the enhancement New feature or request label May 2, 2022
@alallema alallema requested a review from brunoocasali May 3, 2022 07:50
Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

🐕 LGTM!

@alallema alallema merged commit b494f43 into bump-meilisearch-v0.27.0 May 4, 2022
@alallema alallema deleted the cropping_highlighting branch May 4, 2022 12:33
bors bot added a commit that referenced this pull request May 9, 2022
312: Changes related to the next Meilisearch release (v0.27.0) r=curquiza a=meili-bot

Related to this issue: meilisearch/integration-guides#190

This PR:
- gathers the changes related to the next Meilisearch release (v0.27.0) so that this package is ready when the official release is out.
- should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases).
- might eventually contain test failures until the Meilisearch v0.27.0 is out.

⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.27.0) is out.

_This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._

Done:
- #313 
- #315 
- #316 
- #317 
- #318 
- #320 

Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
bors bot added a commit that referenced this pull request May 9, 2022
324: Update version for the next release (v0.23.2) r=curquiza a=alallema

This version makes this package compatible with MeiliSearch v0.27.0🎉 
Check out the changelog of [MeiliSearch v0.27.0](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.27.0) for more information about the changes.

## 🚀 Enhancements

- Add new methods for the new typo tolerance settings #316 `@alallema`
`index.getTypoTolerance()`
`index.updateTypoTolerance(params)`
`index.resetTypoTolerance()`
- Ensure nested field support #317 `@alallema`
- Add new search parameters highlightPreTag, highlightPostTag and cropMarker #318 `@alallema`

## 🐛 Bug Fixes

* Fix `getKeys` method (#323) `@alallema`

Co-authored-by: alallema <amelie@meilisearch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants