From Traditional Search to Semantic Search,Embeddings and Vectors
Artificial Intelligence is changing the way applications search and understand information.Traditionally, databases search information using exact values, keywords, filters, and conditions. This works very well when we know exactly what we are looking for.
But what if we want to search based on the meaning of the information rather than just matching words?
This is where Vector Search comes into the picture. Oracle AI Database 26ai provides native AI Vector Search, which allows applications to search information based on semantic similarity.
1. What is Traditional Search?
Let’s start with something familiar. Suppose we have an employee table and want to find employees from the IT department. We can simply run:
SELECT * FROM employees WHERE department = ‘IT’;
Here, the database checks the value of the department column and returns rows where the value is IT.
We can also search text.
For example:
SELECT * FROM documents WHERE document_text LIKE ‘%performance%’;
Here, the database is looking for the word performance.
This is essentially keyword-based search.
The database is asking:
“Does this data contain the word or value that I am searching for?”
This approach works very well for many traditional database applications. But there is a limitation.
2. The Problem with Keyword Search?
Imagine that a user asks:
“How can I make my SQL queries faster?”
Now suppose we have a document containing:
“SQL query optimization techniques can reduce execution time and improve database performance.”
A human immediately understands that this document is relevant to the user’s question.
But notice that the words are different.
The user said:
“Make SQL queries faster”
The document says: “SQL query optimization” Both have a similar meaning.
A traditional keyword search may not understand this relationship effectively because it primarily looks for matching words.
Consider a few more examples:
|
User Query |
Document |
|
Make SQL queries faster |
SQL query optimization |
|
Database is slow |
Database performance tuning |
|
Improve query response time |
Execution plan optimization |
Humans understand that these statements are related. But how can a computer understand the relationship?
This is where Semantic Search comes in.
3. What is Semantic Search?
Semantic search means searching based on the meaning or context of information rather than only looking for exact keywords.For example, suppose a user searches:
“Find information about making SQL queries faster.”
A semantic search system could identify documents related to:
- SQL performance tuning
- Query optimization Execution
- plan optimization SQL
- response-time improvement
- Database performance
Notice that the exact words don’t necessarily have to be the same. The system is trying to identify information that has a similar meaning.
This is the fundamental idea behind Vector Search.
4. How Does a Computer Understand Meaning?
Now comes an important question. How can a computer understand that:
“Make SQL queries faster”
and
“SQL query optimization”
are related?
This is where AI models come into the picture.
An AI model called an embedding model can convert text into a numerical representation called an embedding.
For example:
Text:
Oracle database performance tuning can be converted into something conceptually similar to:
[0.21, -0.34, 0.87, 0.12, …]
Another sentence:
SQL query optimization could be represented by another set of numbers.
These numbers are not simply keywords.
Together, they represent characteristics of the information that allow AI systems to compare different pieces of data mathematically.
Depending on the embedding model, a vector can contain hundreds or even thousands of numbers.
5. What is an Embedding?
An embedding is a numerical representation of information. In simple terms:
Text → Embedding Model → Vector
For example:
Oracle RAC performance
↓
Embedding Model
↓
[0.12, 0.45, -0.21, 0.87, …]
The embedding model converts the original information into a form that a computer can mathematically compare. Embeddings can be generated for different types of information, including:
- Text
- Documents
- Images
- Other unstructured data
The important concept to remember is:
An embedding converts information into numbers so that similarity can be calculated.
6. What is a Vector?
Now we can understand the term Vector.
In simple terms:
A vector is an ordered collection of numbers.
For example:
[0.12, 0.45, 0.87, 0.23]
This vector contains four numbers, so we can say it has four dimensions.
Another vector might look like:
[0.10, 0.42, 0.90, 0.21]
These two vectors are mathematically close to each other.
When vectors represent text or other information, being close can indicate that the underlying information is semantically similar.
This is the basic foundation of Vector Search. A simple way to remember it is:
Text is converted into an embedding, and the embedding is represented as a vector.
7. A Simple Real-world Example
Let’s take a simple shopping example. Imagine an online shopping application with these products:
- Running Shoes
- Formal Leather Shoes
- Sports Sneakers
- Office Chair
- Cricket Bat
Now the customer searches:
“Shoes for jogging”
A traditional keyword search might look for the words:
- Shoes
- Jogging
But a Vector Search system can convert the search query into a vector and compare it with vectors representing the products.
The results could look conceptually like:
Running Shoes → Very Similar
Sports Sneakers → Similar
Formal Leather Shoes → Less Similar
Office Chair → Not Similar
Cricket Bat → Not Similar
The important point is that the system is not simply checking whether the exact words exist.
It is trying to identify similar meaning.
8. How Does Oracle AI Database 26 ai Fit in?
Now let’s bring Oracle into the picture. Oracle AI Database 26ai provides native capabilities for storing and searching vector data within the database.
A simplified architecture looks like this:
Source Data
↓
Documents / Text / Data
↓
Embedding Model
↓
Vector
↓
Oracle AI Database 26ai
Business Data
Documents
VECTOR Data
↓
Similarity Search
This means the vector representation of information can be stored and searched inside Oracle Database alongside traditional business data. For organizations already using Oracle Database, this can be very interesting because AI search capabilities can be integrated with existing database data and applications.
9. What is Oracle 26ai VECTOR Data Type
One of the important capabilities of Oracle AI Database 26ai is the native VECTOR data type.
For example, conceptually we can have a table like:
CREATE TABLE documents (
doc_id NUMBER,
doc_text CLOB,
doc_vector VECTOR
);
Now a document can have:
- A document ID
- The original document text
- Its vector representation
This is important because the original business information and its AI representation can exist together in the Oracle Database.
10. What is Vector Search vs Traditional Search
Let’s summarize the difference.
|
Traditional Search |
Vector Search |
|
Keyword/value based |
Meaning based |
|
Looks for matching words |
Looks for similar meaning |
|
Exact/lexical matching |
Semantic similarity |
|
Uses traditional database search techniques |
Uses embeddings and vector similarity |
For example, consider the question:
“How do I improve database speed?”
Traditional search may look for:
Improve database speed Vector Search may identify related concepts such as:
Database performance tuning
SQL optimization
Query performance
Execution plan optimization
This is the key difference.
Traditional Search asks:
“Does this contain the word I am looking for?”
Vector Search asks:
“Does this information have a meaning similar to what I am looking for?”
11. How Does Similarity Actually Work?
Once our information has been converted into vectors, we need a mathematical way to determine how similar two vectors are.
For example:
Query Vector
[0.12, 0.45, 0.87, …]
Document Vector
[0.10, 0.42, 0.90, …]
The database can calculate a mathematical distance between these vectors. Conceptually:
Smaller distance
↓
More similar
and:
Larger distance
↓
Less similar
The exact calculation depends on the distance metric being used. The important thing to understand at this stage is:
Vector Search converts information into vectors and then compares those vectors to find the most similar information.
Conclusion
Oracle AI Database 26ai Vector Search may initially sound complicated because we hear terms such as:
- Embeddings
- Vectors
- Dimensions
- Similarity
- Distance Metrics
- Vector Search
But the basic concept is actually quite simple.
Remember this flow:
DATA
↓
EMBEDDING MODEL
↓
VECTOR
↓
VECTOR SIMILARITY
↓
RELEVANT INFORMATION
The most important concept to remember is:
Traditional Search looks for matching words. Vector Search looks for similar meaning.
Oracle AI Database 26ai brings these vector capabilities directly into the database through its native VECTOR data type and AI Vector Search functionality.
This is the foundation for many modern AI applications. And once this foundation is clear, the more advanced topics become much easier to understand.