How Search Works on eDirectory: A Complete Guide
Introduction
Search functionality is one of the most essential components of any directory platform. On eDirectory, the search system is powered by Elasticsearch, allowing users to find listings, events, deals, classifieds, articles, and blog posts with high accuracy and speed. Understanding how the search algorithm works—and how results differ depending on the search method—can help site owners optimize their content and provide the best possible user experience.
This article breaks down the two types of searches users can perform, explains how search fields and weights influence results, and details how sorting options work after a search is completed.
How Search Works for Users
When a visitor uses the search bar in eDirectory—either the keyword field or the location field—the platform uses Elasticsearch to determine the most relevant results. There are two different search experiences, each producing different types of results.
1. Direct Search (User types a term and presses Enter)
This search applies to both the keyword field and the location field.

When a user types a term and presses Search (without selecting a suggestion from the dropdown), eDirectory scans multiple fields across the database. Matches can come from any of the following:
- Title
- Description
- Keywords
- Friendly URL
- Location information (address, ZIP code, city, state, region)
If the typed term appears in any of these fields, the item becomes a candidate for the search results.
This means results can be diverse—for example, searching “Miami” may return:

- Listings named Miami Café,
- Listings located in Miami,
- Articles or blog posts with “Miami” in their content or URL,
- Deals from listings located in Miami.
In a direct search, the system considers all searchable fields to determine relevance.
2. Search with Dropdown Suggestions (User selects a suggestion)
When typing in the search bar, users may see search suggestions appear. These suggestions typically include existing categories or locations already available on the site.

If a user selects one of these suggestions, the search behavior changes significantly:
- The system searches strictly within that specific category or specific location.
- It does not consider titles, descriptions, keywords, or friendly URLs.
- Results are limited only to items that belong to the selected category or location.
This explains why selecting a suggestion may produce different results compared to simply pressing Enter.

Example: Typing “Lawyer” and pressing Enter may show various listings containing the word “lawyer” anywhere in their content.
But selecting the Lawyer category from the dropdown will show only listings assigned to that category, even if others mention “lawyer” in their description.
Sorting Options After a Search
After performing a search—regardless of method—users can sort the results using one of four filters:
- Relevancy
- Distance
- Alphabetical
- Popular

Below is a detailed explanation of how each one works.
1. Relevancy
Relevancy sorting is the most complex and is the default sorting method for direct searches.
When a user enters a keyword, eDirectory evaluates several fields across content modules, each assigned a specific weight that contributes to the final relevance score.
Weighted Fields for Listings, Events, Classifieds & Deals
| Field | Weight |
|---|---|
| Friendly URL | 500 |
| Title | 10 |
| Description | 5 |
| Keyword Information (item keywords, category titles, category keywords; for deals, keywords of the linked listing) | 1 |
| Location Information (address, ZIP, location name) | 1 |
Weighted Fields for Articles
| Field | Weight |
|---|---|
| Friendly URL | 200 |
| Title | 10 |
| Abstract | 5 |
| Keyword | 1 |
Weighted Fields for Blog Posts
| Field | Weight |
|---|---|
| Friendly URL | 500 |
| Title | 10 |
| Content | 5 |
| Keyword | 1 |
Why the Friendly URL Has a High Weight
The Friendly URL carries the highest weight because when a user tries to access a listing that is no longer active, eDirectory redirects them to the search results page. Prioritizing the Friendly URL ensures the summary page for that listing appears prominently (often as the only result), maintaining a smoother user experience.
Location-Based Search Details
When a user searches in the “where” field, the platform evaluates:
- Address
- ZIP code
- City, state, or region names
All with equal weight initially.
Nearby Search Logic
If the administrator enables the “Nearby” feature:
- The system calculates the distance using latitude and longitude,
- It includes listings within a set radius,
- Location fields receive higher weight, ensuring closer results appear first,
- Items are then ordered by proximity within the radius.
Example:
Searching “New York” may show NYC listings first, then nearby listings in New Jersey.
Important: For the Nearby Results feature to function properly, a Google API key must be installed on your site. You can learn how to set this up by following the steps in this article: How to Activate Google Nearby Results API
How Items Are Ordered Under Relevancy Search
eDirectory uses a two-step process:
1. Score (Primary Factor): Generated by Elasticsearch, based on:
- Weighted fields
- How closely the content matches the search term
- Higher score = higher placement.
2. Item Level (Tie-breaker)
If two results share the same score:
- Higher-level items (Diamond → Gold → Silver, etc.) appear first.
Important: Relevance always outranks item level.
Example: A Gold listing named “Restaurant Tokyo” may appear above a Diamond listing named “Tokyo Japanese Restaurant” if the search term is “Restaurant Tokyo.”

How Ordering Works When Browsing or Using Suggestions
When users navigate via:
- Browse by Category

- Browse by Location

- Dropdown suggestions

The ordering rules change:
For Listings, Events, Deals, Classifieds
- Item Level
- Relevance score
For Articles
- Ordered by newest first
For Blog Posts
- Ordered by newest first
For Deals
- Ordered by end date (ending soonest first)
For Events
- Item Level
- Event end date (ending soonest first)
2. Distance Sorting
When sorting by distance, the system:
- Determines the user’s location (via browser permissions or IP),
- Calculates the distance between the user and each listing,
- Displays results from the closest to the farthest,
- Shows distance information directly in the results.

Important: For the Distance feature to function properly, a Google API key must be installed on your site. You can learn how to set this up by following the steps in this article: How to Activate Google Nearby Results API. Additionally, you can learn more about how this functionality works in this article: Understanding eDirectory's Nearby Results Feature
3. Alphabetical Sorting
- This option sorts all results A → Z based on the listing or item title.

4. Popular Sorting
- Popular items are sorted by number of clicks received.
- Listings or content viewed more frequently by users appear first.

Conclusion
Understanding how search works in eDirectory is key for site owners and administrators who want to maximize the visibility of their listings and deliver the most intuitive search experience to their users. Whether users perform a direct keyword search or select a suggestion from the dropdown, the system applies intelligent logic to return relevant results.
By leveraging weighted fields, Elasticsearch scoring, item level hierarchy, and multiple sorting options, eDirectory ensures that users can quickly find what they are looking for—while also giving site owners the tools they need to optimize their content.