Integrating Search and Knowledge Graphs Series Part 1: Displaying Relationships

I’ve spent many years helping clients implement enterprise search solutions and am constantly looking for new ways to improve a user’s search experience so that they can find relevant content as well as discover new content they may not have previously known existed. Recently, EK has spent time designing and building knowledge graphs which has given me ample opportunity to ponder some practical ways to integrate these two powerful technologies.

In this three-part series, I’ll lead you through a phased approach for integrating knowledge graphs with your current search solution. The series will begin with simple, practical steps to help you get started quickly and conclude with an exploration of more advanced functionalities that truly harnesses the semantic capabilities provided by a knowledge graph: 

  • Part 1:  Showing Relationships – Expose the relationships in your content via search results.
  • Part 2:  Enhance Results – Enhance search results by presenting facts, not just returning documents.
  • Part 3:  Provide Context – Leverage the power of the knowledge graph to provide context to your search and improve relevancy.

What is a Knowledge Graph?

A knowledge graph consists of nodes (entities) and edges (relationships), and provides a means to model your domain and expose the rich relationships found within your content. Imagine a tool that lets you show the people, places, and things that make up your domain and the myriad ways each piece of content is connected to another.

Showing Relationships to Enhance the Search Experience

One of the simplest ways to begin integrating your knowledge graph with search is exposing the relationships between content when displaying search results. This increases the discoverability elements of your search results page by not only displaying the results that matched your search, but also valuable, connected content. To accomplish this, find the existing relationships stored in your Knowledge Graph and add them as fields to your search records.

A real world example helps illustrate the necessary steps. Take, for instance, the case of a legal publisher whose content consists of a connected web of statutes, regulations, cases, legal guidance, commentary articles, and a variety of other knowledge assets. The publisher’s knowledge graph contains a node for each piece of content with applicable properties like Title, Published Date, Author, and Code section. Further, a series of edges show the varied relationships between the nodes such as:

– Regulation A derives its authority from Statue B

– Court Case C involves interpretation of Regulation A

– Article E contains references to Court Case C

– Legal Guidance G was mentioned in Article E

Knowledge Graph connecting concepts

Prioritizing Which Relationships Enhance Search

The first step in the integration process is to design the look of the individual search results – which relationships do you want to show for each result. While it’s desirable to show more detail than just the document title as a link, there is still limited screen space available – don’t show all possible relationships. Instead, focus on those that convey additional context or meaning to the user. What are the items that would lead them to follow these links to discover new content.

At EK, we are big proponents of “action-oriented” search which emphasizes understanding what action a user wants to take with the search results. In an Action Oriented Search Workshop, we design how the result should appear on the page. 

A common scenario would be that a user wants to see related documents to the result they’re currently viewing. Referring to the example from the previous section, a user viewing Regulation A as a result may very well want to see related statutes, or court cases which reference “Regulation A.” Instead of presenting a static list of links, the search results can easily be enhanced to display this related content, providing the user with the ability to discover and investigate information they may not have known existed.

search results example

Integrating Relationships Into the Search Engine

Now that we know which relationships we want to display, the next step involves integrating the relationships from our knowledge graph into our search engine. Since we’re only using the relationships for display purposes at this point, all we need to do is store these as additional fields in our search record.

At this point, there are two approaches to integrating the content in your knowledge graph into your search application. One method is to add logic to the search application code which queries the knowledge graph for each search result to obtain the required information. However, this requires a call to a second system (the knowledge graph) which is not as performant as a highly-tuned search engine. The resulting call can have a negative impact on your search performance which can easily lead to user frustration as they wait for the results to render.

The preferred approach is to integrate content from the knowledge graph during the indexing process. Indexing a record involves accessing a piece of content from a source system, processing it into a format that the search engine understands, and then pushing it to the search index for querying. The component that handles this processing is called a “connector.” Normally, we develop our own connectors using custom code to ensure they meet the exact needs of our clients. 

In this approach, the connector code would not only query the source system for content, but also query the knowledge graph to obtain the relevant relationships for that piece of content. These multiple sets of information would be merged together in order to add these relationships as fields to the current record. Further, the indexing process is “off-line” so it’s acceptable if it takes a little longer going into the search engine. Once indexed, the search engine will return results at blazing speed.

For example, let’s say the current record was a specific regulation – “Section 23.2(c)(ii).” By querying the knowledge graph for this particular section, you discover the following relationships exist:

  • “Regulation 23.2(c)(ii)” derives from “Statute 123.456.”
  • The article “Common Issues related to New Requirements” mentions “Regulation 23.2(c)(ii).”
  • The court case “Wyatt v. Hilger, March 7, 2020” interprets “Regulation 23.2(c)(ii).”

json code sample

Storing these relationships in the search index allows us to render a much richer result type to the user.

serach index example


Leveraging the stored relationships for display purposes with your search results is a simple, effective first step to integrating your knowledge graph with your search application. The relationships from your knowledge graph are captured as additional fields in your search records to render intuitive, action-oriented results. 

In summary, follow these steps:

  • Determine which relationships add the most value to search;
  • Design the search UX to display those relationships; and
  • Integrate the relationships into the search engine.

In the next part of the series, we’ll investigate how you can enhance your search results page even further by combining facts stored in the Knowledge Graph with the documents stored in your search engine.

In the meantime, contact us for any assistance with your search and knowledge graph needs.

Chris Marino Chris Marino Chris Marino is a solutions architect with a focus on enterprise search and advanced content management. He specializes in designing and implementing comprehensive KM Systems focused on addressing user needs. More from Chris Marino »