Search API Overview
Introduction
Welcome to the eGain Search API Guide. The Search API allows enterprises to deliver fast, precise, and contextual search results powered by their organizational knowledge. It is optimized to support intelligent filtering, multilingual content, and secure access across different user roles.
Every query returns ranked results, complete with metadata, snippets, and relevance scores. Built on OAuth2 authentication, the API ensures secure, scalable, and role-aware search experiences for customers, employees, and agents.
What It’s Used For
Organizations use the Search API to make knowledge easily discoverable across multiple touchpoints. With rich query filters and multilingual support, businesses can:
- Provide relevant answers in customer portals with minimal effort.
- Enable employees and agents to retrieve articles, guides, and troubleshooting documents quickly.
- Improve customer self-service by allowing users to search FAQs, policies, and knowledge bases.
- Personalize results using tags, topics, and user profiles for targeted retrieval.
- Scale support operations while maintaining accuracy, compliance, and trust.
Common Use Cases
- Customer Self-Service Portals: Let customers search for answers in knowledge bases, FAQs, or manuals directly.
- Agent Assist: Empower call center agents to surface the most relevant articles in real-time, improving first-contact resolution.
-
Multilingual Knowledge Access: Serve localized results using
$lang
, ensuring customers see content in their preferred language. -
Targeted Retrieval: Use
$filterTags
and$filter[topicIds]
to deliver tailored search results based on customer context or product line. - Content Discovery and Navigation: Provide breadcrumb trails and topic hierarchies to help users explore related knowledge.
Overall Workflow
-
User Query Submitted
- The client submits a query (q) along with optional filters such as topicIds, tags, or userProfileID.
- The request is sent to the /search endpoint for the relevant portal.
-
Search Execution
- The API retrieves relevant knowledge articles and content snippets.
- Results are ranked by relevance score (0.0–1.0) for precision.
-
Result Enrichment
- Each result includes snippets, metadata, article type, breadcrumbs, and optional contextual summaries.
- Multilingual and filter-aware searches ensure accuracy for the user’s profile and language.
-
Response Delivery
- The response includes top results (searchResults.article) along with pagination details for browsing large result sets.
- Security is enforced using OAuth2 scopes, ensuring the right level of access (user, customer, anonymous).
Next Steps
Dive deeper into the capabilities of the Search API:
- Filtering: Learn how to refine results using tags, topics, user profiles, and language codes.
-
Pagination and Response Customization:Learn how to efficiently navigate large result sets with
$pagenum
and$pagesize
, and enrich responses by including custom article attributes.