Kenneth Koniouchine
02/15/2022, 8:56 PMsearchParameters = {
hitsPerPage: 10,
q : '*',
query_by : 'title',
facetFilters: ['locationCoordinates: (44.3387557, -79.6795558, 1000.1km)'],
}
And getting this:
`Value of filter field `location`: must be in the (-44.50, 170.29, 0.75 km)
or (56.33, -65.97, 23.82, -127.82) format.`
I get this error while using instantsearch-adapter. Other search parameters work just fine (ex. hitsPerPage)
Hitting the server with curl requests yields either the same error or 'bad request'. Fields are set as facets, and I've tried every possible combination of quotes, backticks, brackets, spaces, decimal points, etc I can think of.
PS. feel free to hit me with Angular related Typesense questions 🙂Jason Bosco
02/15/2022, 9:41 PMKenneth Koniouchine
02/15/2022, 10:22 PMmyCollection = {
'name': `${snapshot.id}`,
'fields': [
{"name": ".*", "type": "auto"},
{'name': '_geoloc', 'type': 'geopoint', 'facet': true},
{'name': 'category.lvl0', 'type': 'string', 'facet': true},
{'name': 'category.lvl1', 'type': 'string',
"optional": true, 'facet': true},
],
} as CollectionCreateSchema;
component.ts
// region Typesense Configuration
config = {
indexName: 'events',
searchClient
} as InstantSearchConfig;
searchParameters = {
hitsPerPage: 10,
q : '*',
query_by : 'title',
aroundLatLng: '45.406431, -78.6848739',
aroundRadius: 1000
}
// endregion
component.html
<ais-instantsearch [config]="config" (change)="setHits($event)">
<ais-configure
[searchParameters]="searchParameters"
></ais-configure>
<ais-search-box [searchAsYouType]="false"></ais-search-box>
<ais-geo-search></ais-geo-search>
<ais-hits>
<ng-template #searchResults let-hits="hits" let-results="results">
<div *ngFor="let hit of hits">
{{hit.title}}
<button (click)="likeEvent(hit.eventId)">Like</button>
</div>
</ng-template>
</ais-hits>
</ais-instantsearch>
Jason Bosco
02/15/2022, 11:02 PMKenneth Koniouchine
02/15/2022, 11:43 PM