meilisearch / meilisearch-js-plugins

The search client to use Meilisearch with InstantSearch.

Home Page:https://www.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when specifying sort parameter in MeiliSearch Angular integration

Karman40 opened this issue · comments

Hello there,

I am currently working on an Angular application that utilizes MeiliSearch for handling reservation data. The application allows users to search through active or archived reservation data. However, I'm encountering difficulties with implementing custom sorting logic when users are looking at archived data.

Here's a brief outline of the feature in question:

  • The user can toggle between viewing current and archive data.
  • When viewing archive data, the requirement is to sort the results differently from the default setting.

It is important that the user does not have to switch, but that this happens automatically.

I have set up search parameters within my Angular component like so:

export class ReservationsAllComponent {
  // ... (other properties)

  // Set up for 'archive' data
  this.searchParameters = {
    filters: `timestamps.dateFrom <= ${moment().startOf('day').unix() * 1000}`,
    // sort: ['timestamps.dateFrom:desc'],
  };
  // ... (other setup)
  
  
  // Set up for 'current' data
  this.searchParameters = {
    filters: `timestamps.dateFrom > ${moment().startOf('day').unix() * 1000}`,
    // sort: ['timestamps.dateFrom:asc'],
  };
  // ... (other setup)

}

Hello @Karman40

Looks like your issue is more related to a support need and not a request for a feature or a bug fix. But most of all, you need quick support to help you play with Meilisearch 😁

We are a small team, so we can’t spend much time doing support this specific repo 😢
You might have noticed when opening the issue we don't do support in this repo anymore.

Capture d’écran 2023-10-11 à 16 56 38

So, if you want immediate help, we would recommend going to our Discord instead. The community will be able to help you, no matter your question.

Sorry if I miss-understood your use-case. If that's the case, let me know.

Thanks for using Meilisearch!