Search is one of those things that everyone takes for granted. It is, of course, ubiquitous. But it really isn’t simple at all. So in this Oracle JSON Insights post we dig into search, explain what is available in Oracle AI Database via SQL and Oracle AI Database API for MongoDB and give you some idea on what is next in search.

A few people using a search light

Why is Search Hard?

Well, there are a number of technical reasons, but the main thing really is that people search for what they mean, not for what is stored in a database. Oh, and it is still hard to answer a search question fast and accurately without any pre-work. Indexing, vectorizing, imagining code paths, are all still a thing.

So with that, let’s dive into some of the search patterns that are helpful in solving the problem for your users in your applications.

Some Search Method Fundamentals

A hierarchy of search methods with short explanations

We start with Key Word Search – which is essentially the next step up from multi-value indexes. It is really the baseline. Type an exact word, and the index kicks in, giving you a result ranked in some order. Here ranking is really the key to getting some good results for a consumer.

But, as we said, users search with meaning, and so key word search is always a bit – well restricted. That is where things like facets come in, and specifically the user interface where a user selects from a pre-populated list of elements (or facets). This is very common in e-commerce application to limit the search results.

But, no one really knows how to type anymore… which gets us to things like fuzzy search. It is key words but now with typo correction (or better – compensation for that). So, makes it less exact for the user, and is of course better than expecting everything to be correctly typed or spoken and pushed to text.

Boolean is a slightly different angle but in the same realm – making inputs a bit more expressive by adding programming style logic. You get nice and precise control over what you are looking for. It’s use of logical operators (AND, OR, NOT) likely works well with people who program and are familiar with this logic and how it really – mathematically – works.

Since we are trying to discern meaning, semantic searches are much closer to engaging a human (or AI) in finding things with more natural descriptions. I’m not sure who remembers every Marvel movie title. So to find exactly what they want using something like “the one with super heroes” isn’t quite getting a good result…

But, using descriptive sentences like “a team of heroes working together to protect others” might get you the Avengers movies (and not Deadpool – who doesn’t know what team means). And so this is where you set up something like a vector search. Vector search creates a representation of what is in the database. The engine makes the query input into a vector. Then you compare those and the closest in the vector space are served as results to the user.

But, that query above might also return Guardians of the Galaxy, or even Star Wars properties. In other words, you may get results based on meaning, but they also become less selective and it becomes harder to rank the results to the exact outcome the user is looking for.

To solve for that, hybrid vector combines the meaning-based vactor search with a good old key word search. And so, hybrid vector is kind of the best of both worlds. We believe many search implementation may end up with hybrid. And so it is worthwhile exploring that a bit more.

Search in Oracle AI Database

Oracle offers a comprehensive solution in AI Database, enabling you to implement these search capabilities in the same engine that stores your data.

A funnel showing all the data types that Oracle AI Database supports

We are writing two post for you to go deep on this, right now. But if you cannot wait, there is a very cool video recording of an AskTom Live session we did on this topic. Go here to see that session in its entirety.

Back to our posts.

The first blog will cover 10+ examples on how implement these search patters on document collections. We show how you can store data in a collection (JSON documents), create the indexes, and write the code to apply the search algorithms. We do all of this through the Oracle AI Database API for MongoDB.

The second post will do the exact same, but now we use SQL examples on relational data. It all uses the same underlying engine, on different data types (tables vs. JSON collections), using different APIs (SQL vs. MongoDB API).

And that is of course the real power here. Same data platform, same capabilities, same security and governance, same great results. Read all about it on the Oracle JSON Insights page and blog posts, right here or watch the AskTom Live session mentioned earlier.

But it’s solved by AI!

Well, that is one answer… and it likely changes how we build applications and what the user experience of an application looks like. But as we rapidly run towards that, there is still a lot of bread and butter searching happening.

And finding the right balance between searching, finding, and ranking, is still something worthwhile understanding and (with the help of your AI buddy) implementing. So, have a look at these capabilities, learn about them, and use them whenever Search is required either by coding yourself or having your friendly AI do it for you…

Oracle JSON Insights

Learn from the team that build the features at Oracle. Read articles like this post, watch demos and webcasts, or start to develop using the LiveLabs, all on available from one page: Oracle JSON Insights.