Autocomplete Search event?

I was hoping to implement an autocomplete search against a fairly large data set of 250,000 items.
It seems that loading the data as Enumerable in the blazor autocomplete fails but limiting it to under 1000 works.

Is there plans to expose an event (Search in the angular control) that allows me to search the data set and return a limited number of results to help with performance?

Thanks! And I love everything you are doing with blazor.

Hi @bobk,

If you set IQueryable as Data the search will be executed directly by your database server and only data that matches your query will be returned.

Best Regards,
Vladimir

If we are using something other then entity framework for storing data this wouldn't work. I use a mixture of MongoDb/ElasticSearch/Redis for my data storage. The biggest part of this is that all of this is hidden behind an API, so with client side blazor a Search event is critical.

Here is my workaround.

  1. bind oninput to a string value to know what the text is in the autocomplete box.
  2. Create a method Data="@GetData()" that returns an IENumerable that can call your API using the string value in (1) to get the results.

In my case I had 2 million items in an IEnumerable list and the performance was horrible. I converted to a TRIE and searched the trie returning enumerable results and performance is great. There is extra chatter now that I am binding the @oninput event.

Altertatively, if radzen could pass the text from the autocomplete in the Data event handler, that would save some extra code.

2 Likes

@bobk that worked like a champ!