Why does the search return unexpected results?

The search returns unexpected results

The search returns unexpected results if the name you have typed contains a special character.

For example, when searching for TOTAL E&P the search doesn't work after you add the P, the result is strange (see below).

Full-text search was designed to search for alphanumeric only. Some literals are allowed like: /.,

Other ones (&_^%$*') are removed behind the scenes.  This means that E&P will be broken into two words E and and both have to be in search vector. In the case we are lucky and the vector was also built from word E&P, the query will match and we are fine. In the case where the search vector was built from word NE&P the search won't match.

The workaround is to miss out the special character.


Similarly, searching for a name which includes an apostrophe will not return any results e.g. the M'bya field in Gabon.  Instead type M bya (missing out the apostrophe).

NB: The database search engine does some preprocessing in the context of language used. For example, removing stopwords (meaningless words existing in language connected with its grammar) in our case words like NOR, AS, THE... are removed and will never be found.  Therefore searching for NOR ENERGY will not return expected result as NOR will be removed.

We are currently investigating switching the search engine to one based on similarity rather than searching for whole sentences and texts.