meilisearch-php icon indicating copy to clipboard operation
meilisearch-php copied to clipboard

[v1.8] Hybrid search improvements

Open curquiza opened this issue 1 year ago • 2 comments

Related to https://github.com/meilisearch/integration-guides/issues/299

Quick explanation of the changes

Related issue in the engine: https://github.com/meilisearch/meilisearch/issues/4481

⚠️ Refer to

  • the usage page for any details about the changes: https://meilisearch.notion.site/v1-8-AI-search-API-usage-135552d6e85a4a52bc7109be82aeca42?pvs=4
  • for a more global and less "digest" overview of the changes (but less precise) check the in-progress changelog: https://github.com/meilisearch/engine-team/pull/64/files

Summary of changes:

  • Handle breaking changes about search
    • vector is not longer displayed in the search response
    • _semanticScore is no longer returned in the search response
    • When adding "showRankingScoreDetails": true to a semantic search query, the vector and its value are no longer displayed
  • Add new models
    • REST embedder
    • Ollama
  • Addition of distribution field in settings
  • New semanticHitCount field in search response
  • Now Meilisearch hides API key

TODO

  • [ ] Ensure breaking changes fit in the code base. It's about removing fields, so "fit in the code base" means
    • [ ] Ensure the code base does not expect any of these fields
    • [x] Fix the tests (if any are broken because of these changes)
  • [ ] Ensure the support of the new models rest and ollama
  • [x] Ensure the support of the distribution field in index settings for embedders
  • [x] Ensure the support of the semanticHitCount in the search response for hybrid/semantic search
  • [x] Now Meilisearch hides API key: fix the elated tests.
  • [ ] Add tests for each of these additions

⚠️ Make PRs pointing to bump-meilisearch-v1.8.0 and NOT main. Please do 1 PR for all of these changes, and not several.

curquiza avatar Apr 07 '24 19:04 curquiza

Please add support for hybrid in FacetSearchQuery. I had to extend that class to make it work with vector search. Thanks.

Example:

Meilisearch\Contracts\FacetSearchQuery
public function setHybrid(array $hybrid): FacetSearchQuery
{
    $this->hybrid = $hybrid;

    return $this;
}
setHybrid([
    'semanticRatio' => 0.5,
    'embedder' => 'default'
]);

DRN88 avatar Apr 20 '24 11:04 DRN88

Hi @DRN88, I'm not sure if I followed you want to use the vector search in the facetSearch but it is not supported https://www.meilisearch.com/docs/reference/api/facet_search

brunoocasali avatar Apr 30 '24 14:04 brunoocasali

Closed by #639

curquiza avatar May 06 '24 17:05 curquiza