aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-10-24 20:22:27 +0200
committerMario Vavti <mario@mariovavti.com>2018-10-24 20:22:27 +0200
commit8b9acf750bde9b21551367f34e57ff549d7d3297 (patch)
treebd22753c7ff512bdd28c4c08f94ced2ca6532d3a /view
parent01e11e904391504417f1a47c4fbb6277c154b5fd (diff)
downloadvolse-hubzilla-8b9acf750bde9b21551367f34e57ff549d7d3297.tar.gz
volse-hubzilla-8b9acf750bde9b21551367f34e57ff549d7d3297.tar.bz2
volse-hubzilla-8b9acf750bde9b21551367f34e57ff549d7d3297.zip
autocomplete performance: this slightly changes the editor contact autocomplete behaviour. queries using *like* with a prepended % to the query string do not make use of indices. this is no big issue when we query abook but can get really slow when xchan table is involved. this commit changes the xchan table only queries to use the *str%* format. this means that the result set for channels we are not connected with will change in a way that xchan_name and xchan_addr will bematched only from the beginning of the name or address. this commit also changes textcomplete to only start the query after the 3rd character. the result set between 2 and 3 characters is mostly very different and only from 3 chars on there is a high possibility the channel we look for is already in the result.
Diffstat (limited to 'view')
-rw-r--r--view/js/autocomplete.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index aa580b163..6b77f0631 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -163,7 +163,7 @@ function string2bb(element) {
// Autocomplete contacts
contacts = {
- match: /(^|\s)(@\!*)([^ \n]{2,})$/,
+ match: /(^|\s)(@\!*)([^ \n]{3,})$/,
index: 3,
cache: true,
search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); },