'Fastest way to filter data from Drupal Backend in Frontend

I am using front-end in Angular, but i need to use the search engine in drupal 9 to access the database instead of using the JSONAPI or bring data in JSON format, because it takes to long to retrieve the data.

This is the code in service

export interface InformesCounter {
  data: any;
  meta: any;
  count: any;
  attributes: any;
  titulo: any[];
}

@Injectable({
  providedIn: 'root'
})
export class FrontService {
  countInformes = 'http://localhost/webagn2019/jsonapi/node/informes?filter[title][operator]=CONTAINS&filter[title][value]';

  constructor(private http: HttpClient) { }

  getInformes(): Observable<InformesCounter> {
    return this.http.get<InformesCounter>(this.countInformes)
    .pipe(
      retry(3),
      catchError(this.handleError)
    );
  }

And this in my component.ts

  showInformes() {
  this.frontService.getInformes()
      .subscribe((data: InformesCounter) => {
        this.informesCount = data.meta;
        this.informesTitle = data.data;
        this.titleList = this.informesTitle.map((data: { attributes: { titulo: any; }; }) => data.attributes.titulo);
        this.onSubmit();
        console.log(this.titleList);
      });
  }

Like you see i use httpget to retrive the data in JSON format and display into the front-end but it takes time to bring more than 2000objects with all the attributes and properties of each one. I know there must be a way to display de data of the backend into the Angular Frontend. But i don't have a clue how to do this.

I will appreciate any help you can provide me.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source