-
Notifications
You must be signed in to change notification settings - Fork 66
Description
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