liveBook · Manning

Solr

As explained in AI-Powered Search

Apache Solr is an open-source search platform built on Apache Lucene that provides indexing, retrieval, and search APIs.

Solr is a search platform that can serve as both a search engine and a knowledge-graph system. Its built-in graph traversal avoids adding a separate graph database and reduces synchronization and infrastructure overhead. section 5.2

Solr’s faceting API traverses terms to documents and back to terms. Its RelatednessAgg function compares foreground and background document sets, normalizing semantic relatedness from −1 to 1. section 5.4.4

A Solr semantic-knowledge-graph traversal can:

  • Start with a term such as “advil” in a document field. section 5.4.4
  • Find other terms occurring in documents associated with that term. section 5.4.4
  • Rank candidates by semantic relatedness and occurrence constraints. section 5.4.4

Discovering related health terms

A traversal over the Stack Exchange health dataset ranks “motrin,” “aleve,” “ibuprofen,” “naproxen,” and “acetaminophen” as related to “advil.” A Solr JSON faceting request performs the query, applies RelatednessAgg, and sorts the terms by the resulting score. section 5.4.4

Listing 5.4 Discovering semantically related terms to advil
health_skg = get_skg(engine.get_collection("health"))

nodes_to_traverse = [{"field": "body",  #1
                      "values": ["advil"]},  #2
                     {"field": "body",
                      "min_occurrences": 2,  #3
                      "limit": 8}]  #4

traversal = health_skg.traverse(*nodes_to_traverse)  #5
print_graph(traversal, "advil") #6

Inspect the compact traversal listing showing the source field, starting value, occurrence threshold, result limit, and graph display call. section 5.4.4

How AI-Powered Search covers it

How deep it goes
Explains traversal mechanics, relatedness scoring, and JSON requests while deferring broader query-time integration patterns.
Examples
Uses the health dataset, the term “advil,” related painkillers, and Solr JSON faceting requests.
What you can do after
Apply it via Solr’s JSON faceting API to traverse terms and rank semantic relationships.
How it connects
Connects search engines with knowledge graphs, inverted indexes, forward indexes, faceting, and semantic search.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.