What is Lexical Search?
Lexical search is the simplest kind of search we’re all familiar with as web developers — it’s search that finds exact matches of a given query string. Searching for “Alice in Wonderland” will only find exact matches for those letters, in that order. In English, “lexical” means “relating to the words or vocabulary of a language”.
Semantic search, on the other hand, finds matches based on the human intent of the query string. Semantic search will know that by “Alice in Wonderland” you might also mean “Alice’s Adventures in Wonderland”.
Is semantic search better than lexical search?
Not at all — they’re just different tools for different jobs! When you’re searching a directory of people (first names and surnames), lexical does a fantastic job. You don’t want everyone similar to Joan Smith linguistically. You want Joan Smith.
And semantic search is incredible when you need to find things that are like other things. You’d be surprised how often you expect search interfaces in your everyday life to find things like other things.