[dev.icinga.com #844] search not returning all results, only first match (without * at the end) #396
This issue has been migrated from Redmine: https://dev.icinga.com/issues/844
Created by Infinity on 2010-10-01 22:00:17 +00:00
Making a normal search with a "regexp" return only the first result.
I might be missing something here, but isnt this the purpose of the search engine? if i want to see all host* so i will be able to search by just typing host?
2010-10-02 13:20:42 +00:00 by mfriedrich 4f28f61
2011-04-05 10:41:36 +00:00 by ricardo d787f07
2011-11-05 16:14:22 +00:00 by ricardo 03224af
2011-11-06 18:54:32 +00:00 by ricardo 46a1e76
2011-11-14 20:37:25 +00:00 by ricardo 3f7f38f
Updated by ricardo on 2010-10-01 23:52:43 +00:00
patch is attached
It usually works with "host*".
With this patch its possible to use "host" without the wildcard character.
Updated by ricardo on 2010-11-05 10:42:21 +00:00
my thoughts about this:
In my opinion status.cgi has to rewritten a quite a bit.
the filters have to apply before any "ouput function" gets triggerd.
And so it's much easier to simply show the prefiltered data.
In main a new function after reading_cgi_vars must be implemented with takes the host and service data, filters it, and putting it into new objects which are get displayed.
At the moment every "display function" is doing this on it's own.
And with this structure it is easy to implement a search.
I hope you get what I tried to say :-)
Updated by mfriedrich on 2011-01-04 07:32:39 +00:00
yep, a new backend api would do the trick, something like livestatus provides now, and the core should provide in that case - extended from the rest.
i'll postpone to next unstable version, ok?
Updated by mfriedrich on 2011-04-27 18:30:39 +00:00
while implementing the display_name search - it's mainly being done over here:
given the fact, that it's not a regex, it would probably need one for the future searches of status.c
so a considered solution can be manually adding a new regexp as host_filter instead of providing the blank host_name as search attribute.
Updated by ricardo on 2011-04-27 23:20:55 +00:00
Would be nice if you have a quick solution for it for now.
As already mentioned, this whole search stuff has to be rewritten.
Updated by mfriedrich on 2011-04-28 09:29:55 +00:00
dunno if the quickfix is applicable for 1.4 though - it would be a replacement hack. but ypou are right, the search needs to be rewritten either way.
regarding the livesearch - i have thought about a while ago. it is possible using e.g. jquery (like most of the examples out there use it).
maybe you'll create a feature request for a new "search.cgi" introducing livesearch (you've deleted jquery recently in git btw) and one for fixing the search all over (the navbarsearch=true indicator in status.cgi is really good, as the mechanism showing host_name OR host_filter via regexp on the cgi works rather perfect. only the section of "what did the user search" is a mess.
Updated by ricardo on 2011-04-28 09:49:33 +00:00
jquery.js is still in the tree.
And it could be included in status.cgi. If it is a search request then it get processed and returned otherwise "the normal way" gets processed. Because in the beginnig you have to load the same data anyway. And yes it will stress the the server. In this case a config option would do the trick.
Updated by ricardo on 2011-11-05 16:20:23 +00:00
this lasted long enough.
now in dev/cgis
please test properly.
Updated by mfriedrich on 2011-11-06 09:09:26 +00:00
wow. #icinga #epicwin
just tested those, works like a charm.
but as a matter of compatibility - plugins like nagstamon are using the search to filter various things in their result view.
could you please add a compatibility layer to keep the following intact?
i (and probably others) have many bookmarks like that. i have not a problem with combining those and showing all matches for the host (if authorized), so that the compatibility would be
only showing the new behaviour. would be great if you could add that into your new implementation too in order to keep support questions low.
below some screenshots on how it looks over here
Updated by mfriedrich on 2011-11-07 08:15:49 +00:00
works as expected. thanks.
could we rename the topic to something like
"rewrite search to not only match hosts, but all hosts/services/groups and their attributes"
and change that in Changelog too? i think ppl don't recognize this issue as it is meant to be. (of course everyone hates native search only looking for hosts).