Search behaviour with a dash '-'

I find the serarch engine in our Open Clinica installations (OC3.8 and also in OC 3.12.2) difficult.

Depending on if there is a dash (‘-‘) entered in any of the fields that is included in a search, the behavior of the search engine is different.

For example if you search for a user, it will search through the fields: ‘User name’, ‘First Name’, ‘Last Name’.
If the user name is for example ‘Frank-Test’ it will not find the user if you search for the string ‘Fran’ or ‘est’, but only when you search for the whole words ‘frank’ or ‘test’
Whereas if the user name would have been ‘Frank_Test’ you would find this record if you search for any string within the name. So searching for ‘est’, ‘Test’, ‘ran’ or even just ‘f’ would find this record.

Does anybody know …:
1) If this is indeed the intended behavior of OpenClinica?
2) If this can possibly be changed by configuring the Postgress database differently? or
3) if there is something else going on?
Tagged:

Comments

  • BinaryVisionBinaryVision Posts: 38
    We only allow usernames with the _ character since 3.1.4 in our environment. Maybe this is a known issue?
  • haenselhaensel Posts: 558 ✭✭
    The '-' has a special meaning within the search logic. This might be the reason that it does not work. Please have a look at the implementation for further informations

    EntityBeanTable

    good luck and regards,
    Christian Hänsel
  • haenselhaensel Posts: 558 ✭✭
    Excuse me. I didn't mentioned that it is not possible to achieve the result by modifying the database logic.

    Regards,
    Christian
  • haenselhaensel Posts: 558 ✭✭
    Hi

    Gerben and I had a closer look to the search logic and it is indeed an issue related to the dash '-'. It would be best to use the proposed workaround of @BinaryVision and avoid '-'.

    Regards,
    Christian
  • FZweerusFZweerus Posts: 12
    Thanks for the feedback Christian.
    We already use this workaround for the field username.
    However the difficulty with this workaround is that in reality it applies to many fields in many tables. When searching for users for example it also means that you would have to avoid the dash in the fields: 'first name' and 'last name'.
    When searching for a study for example, it means you have to avoid the dash in the field containing the name of the principle investigator.
    And these are just two examples.
  • haenselhaensel Posts: 558 ✭✭
    So the only option is to modify the source code. Are you able to build your own customized OC version?

    Regards,
    Christian
  • FZweerusFZweerus Posts: 12
    Unfortunately not at this moment. I am involved as an external consultant for a customer that uses OC for their projects. Now we have figured out what the cause is, and know that there is no 'easy' way around this, we can temporarily live with this workaround/ limitation. It is not a showstopper. I am pretty sure my customer would hate the idea to branch off for something like this. So we will continue to use it with the known limitation and hope to see it addressed in a future version.
  • haenselhaensel Posts: 558 ✭✭
    That sounds like a wise decision.

    Regards,
    Christian
Sign In or Register to comment.