Orchard icon indicating copy to clipboard operation
Orchard copied to clipboard

Performance issues on taxonomy autocomplete

Open MarcoViglione-Laser opened this issue 7 years ago • 2 comments

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 inside TaxonomyService.cs, which just consists of a contentManager.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 (through TagController.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.

MarcoViglione-Laser avatar Feb 19 '19 09:02 MarcoViglione-Laser

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.

Skrypt avatar Feb 19 '19 17:02 Skrypt

Fine with a spinner. Can the service also be cached?

sebastienros avatar Feb 21 '19 20:02 sebastienros