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

Make insidePolygon compatible #555

Open
bidoubiwa opened this issue Oct 13, 2021 · 0 comments
Open

Make insidePolygon compatible #555

bidoubiwa opened this issue Oct 13, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@bidoubiwa
Copy link
Contributor

⚠️ related to this PR, does not need solving before it is merged #543

MeiliSearch needs a geographic point around which it will search for hits. InstantSearch provides an insideBoundingBox that is defined by two geo points.

To determine the center point of the insideBoundingBox, instantMeiliSearch uses a Geographic Midpoint Algorithm. It only handles 2 points for now.

Polygons on the contrary provided multiple geo points. Because the algorithm only handles 2 points, we can not find the geo center point needed by MeiliSearch. To implement it we need to follow the instruction provided in step B of this article.

The objective of this issue is to implement this improved algorithm in order to be compatible with the insidePolygon parameter.

  // geo-rules-adapter.ts
  if (insidePolygon) {
    console.warn(
      `instant-meilisearch: \`insidePolygon\` is not implented in instant-meilisearch.`
    )
  }

More information on how the provided data is provided can be found on instantSearch documentation.

The algorithm can be found in src/utils/geographic.ts

@bidoubiwa bidoubiwa added the enhancement New feature or request label Mar 22, 2022
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

No branches or pull requests

2 participants