Menu

#1067 Changes to autocomplete for Names/Surnames

open
nobody
None
5
2008-12-08
2008-12-08
No

I find that sometimes the autocomplete for names and surnames is actually more of a hindrance than a help. Especially the forename autocomplete. It is just too slow and takes too long to narrow down to the name so I often finish typing before it finds the correct name.

One improvement would be to change the way it searches. For instance: I type Or and it's giving me choices like George and Morgan as well as Orville. Now this is just made up as an example (No Orville in my tree yet). But why on earth would I type "Or" if I wanted George or Morgan? If the search was limited to names beginning with "O" and then "Or" and "Orv", etc I think it would achieve an increase both in speed and in usability.

Discussion

  • Anonymous

    Anonymous - 2008-12-11

    Stw

    I havn't had an opportunity to try this, but you could have a go. In autocomplete.php, change line 500 from:
    " WHERE i_name ".PGV_DB_LIKE." '".$FILTER."%'".

    to:
    " WHERE i_name REGEXP '^".$FILTER.

    This ought to work for MySQL, but I don't know anything about other DBs.

     
  • Stew Stronski

    Stew Stronski - 2008-12-11

    Yeah I don't know anything about other DBs either. I'm also not sure how it would affect RTL languages. There might be good reasons that it's configured the way it is.

    If I have time I might check out PGV_DB_LIKE and see if I can figure out what it's doing and why.

     
  • Anonymous

    Anonymous - 2008-12-11

    Stew, the problem isn't in PGV_DB_LIKE, that just alters the select statement to cope with different databases (some use 'like', some something else). The problem is in the rest of the line 'like $filter%' just tells it to look for your letters ('OR' for example) followed by 'anything'.

    My suggestion 'should' change that so it looks for 'OR' at the start of the word. I've had a chance to test it now on my own site. I find the code should be:

    " WHERE n_givn REGEXP '^".$FILTER."'".

    That certainly seems to work for me, but I do use MySql.

     
  • Stew Stronski

    Stew Stronski - 2008-12-12

    Thanks for the info Nigel. I use MySQL myself. I've been too busy to check out any of it yet unfortunately.

     
  • Greg Roach

    Greg Roach - 2008-12-12

    The speed of this has been dramatically improved recently. Previously, we had to search the full names and extract the given names. Now, we have a column containing given names.

    Line 491 (current SVN) reads;
    " WHERE n_givn ".PGV_DB_LIKE." '%".$FILTER."%'".
    To change it to matching only the leading letters of the name, remove the first %.

    But with the improved speed, it seems to work OK. You'd only need to type an extra character (orv) to find orville.

     
  • Anonymous

    Anonymous - 2008-12-12

    Greg

    Thanks for stating the obvious :-))

    I had assumed that LIKE $FILTER % would still look beyond just the start of the name. This is better, as it preserves the diferences between DB types.

    Regardless of speed, I agree with Stew. We are most likely to enter the FIRST characters of a name, so don't want to find everything else that includes those characters anywhere else. So I wonder if the same change should be made in all the autocomplete fields? It is, after all, 'autoCOMPLETE' not 'autoFIND'.

     
  • Greg Roach

    Greg Roach - 2008-12-12

    <<We are most likely>>

    Everyone (myself included) assumes that other people work the same way we do.

    I start typing unusual letter sequences. e.g. if I'm searching for "North Clwyd",
    I'd type "wyd" rather than "nor".

    I like it as it is(!) - but if you can establish a consensus of opinion to the contrary, I'll change it.

     
  • Anonymous

    Anonymous - 2008-12-12

    Thats a fair point.

    I'll start a discussion, and see where it goes. perhaps I'll end up changing the way I use it too. :-))

     
  • Graham Shepherd

    Graham Shepherd - 2009-01-19

    I strongly support this request. Autocomplete for family names and places is excellent. However, I find that autocomplete for given names is actually a complete time waster. A spellchecker based on names already in the database might be more useful.

    The implementation of autocomplete seems to have some issues. If I start typing and then have to retype the name because of a spelling error for example, the system often freezes for me.

     
  • Stew Stronski

    Stew Stronski - 2009-01-19

    <<If I start typing and then have to retype the name because of a spelling error for example, the system often freezes for me.>>

    I think a lot of my problems with autocomplete are caused by exactly this. A slight pause in typing or hitting backspace to make a correction seems to cause multiple concurrent queries which eventually freezes the whole site when max db connections are reached. The only way to unfreeze things is to go to my control panel and stop/start MySQL. This has several times resulted in some corruption in the DB. Maybe a longer delay in starting the query might help.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.