Search, space and multiple fields : The story of a search engine

Say my model has :

  • a first name : Alberto
  • a last name : Guterès

He is from Mexico, he is a little overweighted, wears a sombrero and have sweating patches at his armpits.

Now say I have the following sib-display :

<sib-display
  search-fields="name"
  set-name="first_name, last_name"
></sib-display>

If I type :

  • Alterto : it works !
  • Guteres : it works !
  • Alterto Guteres : it doesn't work..

The space is not handled between fields. I believe it should behave this way :

Pseudo code :

  1. Hello, I am the search engine
  2. Oh, here is the query Alberto Guteres
  3. I split you up by bitch : var queryStrings = ["Alberto", "Guteres"]
  4. If first_name +" "+ last_name contains all the strings within queryStrings : it is a match !

Not having this feature makes Alterto really sad :

72454169

Edited by Ghost User