Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User is not found when is searched by name and one of surnames #7510

Closed
fgsl opened this issue Dec 14, 2017 · 12 comments
Closed

User is not found when is searched by name and one of surnames #7510

fgsl opened this issue Dec 14, 2017 · 12 comments

Comments

@fgsl
Copy link

fgsl commented Dec 14, 2017

Premise

User backend in LDAP

Steps to reproduce

  1. Upload a file
  2. Click on sharing icon
  3. Search for a user, using name and first of surnames. For example: User is "Roger Luis Padilha de Souza". Then, search for "Roger Luis". User will be found.
  4. After, search for same user, using name and one for surnames, except the first of them. For example: User is "Roger Luis Padilha de Souza". Then, search for "Roger Padilha"
  5. User won't be found

Expected behaviour

User must be found using name and one of surnames

Actual behaviour

User is found only if search uses name and first of surnames

Constraint

Behaviour must be defined by configuration (config.php). Default must be actual behaviour. Expected behaviour must be enabled by key user_ldap.enable_medial_search equals to true.

@MorrisJobke
Copy link
Member

Looks like a duplicate of #1749 which was fixed by #7169 - please check the Nextcloud 13 and verify it works for you.

@fgsl
Copy link
Author

fgsl commented Dec 14, 2017

@MorrisJobke

We tested Nextcloud 13 beta1, available in Nextcloud website. In this version, search by name keeps working like previous releases.

For every word that you types the wildcard '*' is only append to string, never prepend to it.

We know that can reduce performance, but it's better to be slow than don't find users. But if it could be enabled by configuration, current behaviour can be kept as default behaviour.

For example (for case of my search attributes be "cn", "sn" and "givenName"):

dn: uid=4815162342,ou=sec,ou=sec2814,dc=corps,dc=gov,dc=br
cn: Roger Luis Padilha de Souza
sn: Luis Padilha de Souza
givenName: Roger

Only way to find this user is typing "roger" or "luis".
Whatever other way, I can't find this user:
If I type "souza", user is not found.
If I type "padilha", user is not found.
If I type "roger padilha", user is not found.
If I type "roger luis", user is not found.
If I type "roger souza", user is not found.

In Brazil, names of people are long. There are people with a name and three or four surnames. Beyond that, in Brasil the first name can be simple or composed. So it is hard to be a 'perfect' register in LDAP.

@MorrisJobke MorrisJobke reopened this Dec 14, 2017
@MorrisJobke
Copy link
Member

cc @nextcloud/ldap

@blizzz
Copy link
Member

blizzz commented Dec 15, 2017

The search goes via LDAP. Typically, you'd define seperate User Search Attributes, mostly it is "sn" and "givenName", but it depends on your use of LDAP. Then the order of the name does not matter.

@fgsl
Copy link
Author

fgsl commented Dec 18, 2017

@blizzz, really the order of terms in search doesn't matter. Problem is that application user (who makes searches) doesn't know how user register was built in LDAP.
Here we use "givenName", "sn" and "mail".
Our problem is mainly "sn" that has a lot of surnames... so, if search is not made exactly by first surname, user doesn't find anything.

@blizzz
Copy link
Member

blizzz commented Dec 18, 2017

@fgsl this is mostly an LDAP issue, sorry. Either abouts is'ts config, structure or search abilities. When a search term contains a space, we already take them as single words and compare every configured attribute against "word1*", "word2*", etc.

It's possible to make it work by prepending the asterisk in front, however this kills performance totally because LDAP cannot make use of any index. You basically have a (multiple) full table read. This is just not acceptable and an even worse UX.

If possible, split up the sn parts into a differnet attribute. It might be that you can work with multi value attributes, and insert each single surname as a seperate value. Create an index on LDAP for it and use this as search attribute. I didn't try it so i am not sure it works, but I think it's likely.

@fgsl
Copy link
Author

fgsl commented Jan 30, 2018

Hi, @blizzz.

Performance issue of LDAP is known but customer should have right to choose that configuration or not (Owncloud has a reservation about performance if customer decides to use that option).
In our user base, for example, we have users from 2 to 7 names. So, it is impracticable to put each surname in a distinct attribute.

@blizzz
Copy link
Member

blizzz commented Jan 31, 2018

Well, as said you can prepend * to your searches.

Otherwise I'll accept a hidden (→ occ only) per-config setting pull request (or talk to Sales ;) )

@fgsl
Copy link
Author

fgsl commented Feb 1, 2018

@blizzz , excuse me, I didn't understand what could be a hidden per-config setting. Are you talking about not including that in documentation?

@MorrisJobke
Copy link
Member

Well, as said you can prepend * to your searches.

I would still like to have this properly documented instead of adding another hidden feature that adds more code. You could simply search for "*eyer" to find "Meyer" aswell as "Beyer" in the search field.

@fgsl
Copy link
Author

fgsl commented Sep 14, 2018

I have submitted a new proposal, where asterisk is introduced among words.

@fgsl
Copy link
Author

fgsl commented Feb 4, 2019

I am closing this issue because it seems that change don't generate an advantage for all.
A fork with this change supplies the demand for while.

@fgsl fgsl closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants