Proximity Search: How It Works, Examples, and Uses
Proximity Search is performed when you want to find text or data in which two or more search terms appear close to one another. This technique checks presence of decided words and also how closely they are within the text. This technique becomes useful when you know terms to be searched in message or document but you don’t know exact wording or location. This search helps to narrow down results by considering how close searched terms are to each other. Distance and word-order rules depends on search system that is executed on defined range.

What Is Proximity Search
In simple words it shows how close two or more search terms appear to one another. It does not mean words have to be side by side. Other words can appear between them and some search tools also allow terms to appear in different order. For example, you are searching for collection of emails for “confidential” and “account” words. Search that requires both words will find a long email even when they appear in unrelated sections.
Proximity search can narrow results to messages where terms appear within the distance allowed by search system. You can think of two clues that appear near each other on page and two clues that happen to appear somewhere in same document.

How Proximity Search Work ?
Proximity search inspects and do analysis of where search terms are appearing in document and then applies distance, relevance and word order rules of platform you are using to perform search. Let us break this process into four easy steps for you.
- Select terms: Enter two or more words that you are planning to find together in context.
- Set and apply distance rule: This thing defines how close terms must be. Some tools let user enter distance. Many apply their own proximity based ranking.
- Text Evaluation: System then checks terms’ positions or relative distance and applies any word-order condition.
- Return and Rank Results: There are two types of tools some returns records that meet condition. Others give relevance to records where terms occur close together.

Note: Proximity search do not work identically on every product. In some tools, it is matching condition. In others it is relevance signal that helps order results.
Understanding Word Distance and Word Order
Word distance: This means how far one search term appear to another. In simple words it is distance between the words. Many tools define this distance by counting words between search terms. Some apply their own positioning rules.
For clarity: Count words between terms: Employee sent confidential file to an external account.
There are four words between confidential and account. They are file, to, an, and external. If a rule is set that allows up to four intervening words. Above example will meet distance condition.
Word Order: It is an unordered search that can accept terms in either order. Ordered search needs search term to appear in sequence that is clearly specified in query. This difference changes which documents match.

Proximity Search Operators
Proximity operator is a command or symbol that instructs search systems on how to search for terms that appear near one another. Naming of these operators and syntax depends on database and platforms. There is no single format that works everywhere.
- N or NEAR: This in some systems, find terms within specified distance without requiring entered order. EBSCO uses N this way.
- W or WITHIN: Finding of terms within specified distance and preserving entered order. EBSCO’s W operator is an example.
- ~N: PubMed uses this form for proximity searches in supported fields. It is documentation that defines N as maximum number of words between terms.
For example, EBSCO documents tax N5 reform as unordered search and hiking W5 trails as an ordered search.
PubMed uses format such as “rationing healthcare”[Title:~2] to find terms within two intervening words in Title field.
Note: These examples apply to their named platforms, not every search tool.
Proximity Search vs. Exact Phrase Search
Exact phrase search (General Search) and proximity search are different both consider how words appear together. They both use different matching rules. Let us check difference between the two.
| Search Method | What it looks for |
|---|---|
| Exact phrase search | Words that are next to each other in specific order |
| Proximity Search | Words in an allowed distance. Other words can appear between them, and order depends on operator. |
| Boolean AND search | Both terms in search scope. Without setting maximum distance between them. |
If you perform exact search for: “data breach”. You will get this phrase in exact order. Proximity search for data and breach will also find “ breach involving customer data,” If tool’s distance and order rules allow it.
When exact wording matters in your result use phrase search. Proximity search is to be used when search terms can be separated but their closeness matters. Use Boolean operators to combine or exclude concepts: Some tools and systems also let searchers combine Boolean and proximity conditions.
Related Read: Best Search Options for Precise Email Investigation
Where Proximity Search Is Used
Proximity search is needed when connection or closeness in passage matters. This becomes very useful when long documents and large collection of text is to be searched or investigated.
- Academic research: Find papers where concepts like “climate” and “adaptation” appear close together.
- Legal research: To locate passages, where terms like “duty” and “care” near each other. Match identifies text to review.
- Document review: Users use proximity search to narrow large collection of files where related terms appear in same passage.
- Email and digital forensics: Investigators use proximity search to find evidence in communication where terms such as “invoice” and “payment” or “password” and “reset,” occur close together.
Proximity search helps in narrowing results through finding words that appears near to each other. Distance matters, small distance can miss useful results and at the same time large distance can include unrelated matches.
Some search tools use word closeness to rank results rather exclude distant matches. Two words that are appearing close together do not prove connection, intent or wrongdoing. User or investigator should read surrounding text before drawing conclusion.
In proximity search understanding distance, word order, operators and context helps in interpreting matches more carefully. Now we will move from general concept to application of Proximity search in MailXaminer, an email forensics software using its verified interface and workflow.
Why Select Proximity Search in MailXaminer
This professional tool comes with six search methods each developed for different type of search.
- General Search
- Fuzzy Search
- Wildcard Search
- Regex Search
- Proximity Search
- Stem Search
Difference is Proximity Search takes distance between search terms into consideration. It is useful when you want to find specific words appearing close together in email. It is better for investigators trying to find relation rather than simply finding emails containing those words. For detailed demonstration, we will search for two terms, “spoke” and “friend,” within email body.
Part 1: Prepare Case and Open Indexed Data
For performing Proximity Search, user should create case in this tool and import email data that is to be examined. Make sure data is loaded and available for searching.
- Step 1. Open required case: Select case containing your loaded email evidence.
- Step 2. Access Indexed Data: Click Indexed Data at left sidebar. This will open a section where you can access and search loaded evidence.

Step 3 Building of Email Search Condition: Click Advanced Filter for opening query-building interface. Here, you can create search conditions and groups for narrowing your search.

Step 4. Choose logical condition: Select AND or OR, as per your search requirements.
- AND: Requires all connected conditions to be satisfied.
- OR: Allows match when any one of connected conditions is satisfied.
Click (+) icon and select Add Condition to create new search condition.

Step 5. Select email field.
In new condition field, you can decide your field as per your requirements. We are selecting Email.Body from field dropdown. This will instruct this tool that we want to search within email message body only. Next, field contains, as condition operator. This defines field condition for search.

Part 2: Configuring Proximity Search and Distance
Step 6. Select search method: Before entering search terms, click settings (gear) icon near value field. Available search methods will appear. Select Proximity Search from dropdown list.
Step 7. Set Distance: Once Proximity Search is selected, enter maximum number of intervening words you want to allow between search terms. For this example, we are setting Distance to 8.

Note: Once value is set. Small P8 indicator will appear beside settings icon. This indicates Proximity Search is selected with distance value of 8.
Step 8: Enter search terms: Now enter two search terms in this example we are using “spoke” “friend”. This will instruct this tool to search selected email body field for these terms using configured proximity distance.
Step 9. Apply the search. Click Apply at bottom right to execute configured search. In our demonstration this tool returned 8 email results matching search conditions. Click View Results to open matching emails in Indexed Data.

Step 10. Examine matching email: Open qualified results to inspect email content. This tool highlights searched terms in message, making them easier to locate. For example, one of our matching emails contains this passage.
I hear you. However, what’s changed since the last time you and I spoke about this project is that our friend Bill Wise has been talking.
Notice these words between carefully: “spoke” and “friend”:
about · this · project · is · that · our
Six intervening words between two search terms. As our decided distance is 8, these intervening words between our search terms falls within selected limit.

Understanding the Distance setting
In our example distance 8 allows up to eight intervening words between decided search terms. Passage with nine intervening words will fall outside this limit.
Note: For searching terms that are farther apart, increase distance value and apply search again.
Remember: P8 and qualified number of results: 8 are two different things. P8 indicated configured proximity distance. Results: 8 represents number of matching emails records returned in this demonstration.
Investigators who handle complex investigations. Through Advanced Filter, they can also add multiple conditions and groups, combining them with AND or OR. They can also add or configure different search methods to refine their search further.
Wrapping Up
This completes Proximity Search demonstration in MailXaminer. You can use distance setting to control how much further your search terms appear and examine matching emails to understand their surrounding context.
Frequently Asked Questions
Q: What is the main purpose of Proximity Search ?
A: Proximity search helps in finding words that appear within specified distance of one another. It helps in narrowing results when relationship between search terms matters.
Q: How Proximity search is different from Exact Phrase search ?
A: Exact Phrase Search looks for words together in specific order. Proximity Search allows other words between them within permitted distance, depending on search rules.