Skip to main content
Topic: [ADDON] [WIP] Live search (Read 1572 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[ADDON] [WIP] Live search

Lurking around, I noticed an interesting idea, so I decided to give it a try.
For the moment it's just a bunch of code not yet fully working, so I'll keep the code for myself until finished, but I can share a picture (see attachment).

The idea is to use the search box at the top to return results "live" while typing.
Of course we all know that the search is one of the most demanding functions, so install this addon could easily kill your server if any of your users or guests may decide to play you a trick.

For the record I'm not using Elk's search function, I decided (at least for the moment), to use a simple query with a LIKE on just the subjects. Of course I have no idea if this creates more or less problems to the server (any hint is welcome!).

Client-side I decided to use Angularjs again.

Before the release I'll try to think about ways to avoid abuse of the function, even though it's quite difficult because the "live" part is the only attractive one... well, for the moment it's not very important, and even later I may just suggest you not to install the addon or to remove it if your server dies. :P

P.S.
The magnify lens instead of "search" may be something to consider for the "core", though... O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] [WIP] Live search

Reply #1
Very nice :)


Re: [ADDON] [WIP] Live search

Reply #3
Cool idea  :D
The idea is to use the search box at the top to return results "live" while typing.
Of course we all know that the search is one of the most demanding functions, so install this addon could easily kill your server if any of your users or guests may decide to play you a trick.

For the record I'm not using Elk's search function, I decided (at least for the moment), to use a simple query with a LIKE on just the subjects. Of course I have no idea if this creates more or less problems to the server (any hint is welcome!).
A simple like is not going to have any relevancy to the hits, I suppose you could do a recent first since a subject only search is not very accurate anyway.  Personally I feel you are a lot better off  (a lot better off) using the built in search functions for a variety of reasons.
Client-side I decided to use Angularjs again.
Still something I've never used, maybe someday, but my stack is full so something would have to drop off :P
Before the release I'll try to think about ways to avoid abuse of the function, even though it's quite difficult because the "live" part is the only attractive one... well, for the moment it's not very important, and even later I may just suggest you not to install the addon or to remove it if your server dies. :P
Certainly a permissions setting would be good, along with a more restrictive searches per time limit (maybe no error, it just acts normally at if inside the limit)

P.S.
The magnify lens instead of "search" may be something to consider for the "core", though... O:-)
+1 !
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] [WIP] Live search

Reply #4
A simple like is not going to have any relevancy to the hits, I suppose you could do a recent first since a subject only search is not very accurate anyway.  Personally I feel you are a lot better off  (a lot better off) using the built in search functions for a variety of reasons.
Yep, I have the feeling that kind of search is not very relevant, it gives *some* results hopefully without much overload, though it's just basically random.
I'll have a look at using the built in functions. :D

Client-side I decided to use Angularjs again.
Still something I've never used, maybe someday, but my stack is full so something would have to drop off :P
LOL
It's actually rather "simple" (unless you want to do complex things of course).
It cannot be directly compared to jQuery, though it feels easier to use and more "straightforward" (especially in the sense that it gives you a clear direction on how to do things).
I started with that course:
https://www.codeschool.com/courses/shaping-up-with-angular-js

Certainly a permissions setting would be good, along with a more restrictive searches per time limit (maybe no error, it just acts normally at if inside the limit)
Maybe also a token may help, in order to ensure that who is searching is actually doing it from the webpage, or at least close to it.

P.S.
The magnify lens instead of "search" may be something to consider for the "core", though... O:-)
+1 !

 emanuele tracks the +1 O:-)
Bugs creator.
Features destroyer.
Template killer.


Re: [ADDON] [WIP] Live search

Reply #6
Very cool  8)
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.