Bug 30533

Summary: Limit substring search in UMC
Product: UCS Reporter: Tim Petersen <petersen>
Component: UMC (Generic)Assignee: UMC maintainers <umc-maintainers>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 CC: best, gohmann, klaeser, wiesenthal
Version: UCS 3.1   
Target Milestone: UCS 3.2-x   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=37904
https://forge.univention.org/bugzilla/show_bug.cgi?id=40740
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:

Description Tim Petersen univentionstaff 2013-02-21 09:32:39 CET
With UCS 3.1 search queries are automatically matching for substring results. Before UCS 3.1 there was the need of using wildcards for achieving this behaviour.

In bigger environments, this change could be counterproductive. This was also requested at ticket #2013022021002929

It would be nice to have the opportunity to configure the old search behaviour via ucr.
Comment 1 Dirk Wiesenthal univentionstaff 2013-02-21 11:00:29 CET
Two possible implementations: 
  On startup of module:
    univention/management/console/modules/sanitizers.py +407
      self.use_asterisks = kwargs.is_true('use_asterisks', ucr.is_true('directory/manager/web/modules/substringsearch'))
  On each request, something like:
    univention/management/console/modules/sanitizers.py +423
      if self.use_asterisks is None:
        use_asterisks = ucr.is_true('directory/manager/web/modules/substringsearch'))

"On each request" needs to reload ucr for every PatternSanitizer but it does not require a reload of UMC. As I suppose this is changed at most once in the lifetime of a UCS server, I guess it would be sufficient to check on startup.

If we make that configurable in UDM, should we also include UCR, Extended Software Management, Services modules?
Comment 2 Stefan Gohmann univentionstaff 2013-02-21 11:07:29 CET
Let's wait if we get more feedback like this.
Comment 3 Stefan Gohmann univentionstaff 2013-03-05 10:34:40 CET
I think it would be better if the search can be limited with ", for example:

Search string: test → finds test, test1, test2, ...

Search string: "test" → finds only test
Comment 4 Alexander Kläser univentionstaff 2013-03-06 14:14:32 CET
(In reply to comment #3)
> I think it would be better if the search can be limited with ", for example:
> 
> Search string: test → finds test, test1, test2, ...
> 
> Search string: "test" → finds only test

Another option would be to use < and > from regular expressions (word boundaries).
Comment 5 Dirk Wiesenthal univentionstaff 2013-03-06 14:26:45 CET
(In reply to comment #4)
> (In reply to comment #3)
> > I think it would be better if the search can be limited with ", for example:
> > 
> > Search string: test → finds test, test1, test2, ...
> > 
> > Search string: "test" → finds only test
> 
> Another option would be to use < and > from regular expressions (word
> boundaries).

Yes, but our * does not work like the regular expression * either. I guess this would be counter intuitive. "test" works more like google and more or less every admin uses it like this.
Comment 6 Alexander Kläser univentionstaff 2013-04-19 10:46:44 CEST
*** Bug 30190 has been marked as a duplicate of this bug. ***
Comment 7 Alexander Kläser univentionstaff 2013-04-19 11:21:39 CEST
(In reply to comment #6)
> *** Bug 30190 has been marked as a duplicate of this bug. ***

Also consider the information from Bug 30190:
> Attributes that were not defined in the schema-file as:
>     SUBSTR caseIgnoreSubstringsMatch
> 
> cannot be searched: Since UCS 3.1 asterisks are automatically added to the
> search filter:
> 
> Search for "user" -> Search for "*user*"
> 
> This means that attributes without the SUBSTR definition will not be found even
> if one searches for exactly the name as in LDAP.
> 
> This also holds for third-party-extensions.
Comment 8 Florian Best univentionstaff 2016-10-07 18:11:33 CEST
I improved the substring search in some UCS 4.1-0-errata and implemented the solution from comment #1 in Bug #42181.

*** This bug has been marked as a duplicate of bug 42181 ***