Open MarcoViglione-Laser opened 5 years ago
You could maybe also try to index those Taxonomy terms in a separate table so that it retreives only what's needed like we do in OC. I don't remember exactly if we do this in Orchard but if it's retreiving records directly from the main content table then that's probably why it's slow.
Fine with a spinner. Can the service also be cached?
I have a taxonomy with more than 3000 terms. I tried to put a taxonomy field referencing it in my content type, but the autocomplete results take between 5 and 10 seconds to appear. During this time there is nothing telling the user that elaboration is in progress, and if he clicks anywhere else on the page the results are never shown. The method taking a lot of time seems to be
GetTerms
insideTaxonomyService.cs
, which just consists of acontentManager.Query
instruction followed by a sort. I even tried to create an index on the column used in the where clause but nothing changed. Considering that this method is called by the autocomplete javascript using an ajax call (throughTagController.cs
) I would suggest to show a loading spinner starting with the call and disappearing when the results are ready. If you agree with this workaround, I can work on it in the following days.