Skip to main content
Topic: [ADDON] [WIP] Live search (Read 4618 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 #2

Brilliant @emanuele . Never seen it in any popular forum script.

Re: [ADDON] [WIP] Live search

Reply #3

Cool idea  :D
Quote from: emanuele – 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.
Quote from: emanuele – 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
Quote from: emanuele – 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)
Quote from: emanuele –
P.S.
The magnify lens instead of "search" may be something to consider for the "core", though... O:-)
+1 !

 

Re: [ADDON] [WIP] Live search

Reply #4

Quote from: Spuds – 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

Quote from: Spuds –
Quote from: emanuele – 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

Quote from: Spuds – 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.

Quote from: Spuds –
Quote from: emanuele – 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 #5

Okay, pushed the first commit that uses the "custom search":
https://github.com/emanuele45/LiveSearch
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] [WIP] Live search

Reply #6

Very cool  8)