1

I need select categories for breadcrumbs from solr, where categories will be ordered by parent like this:

Super-parent > Child A of super-parent > Child B of child A > ...

So for instance this is our solr documents:

[
  {
    "parent_id": 2222,
    "name": "Category A",
    "id": 1111
  },
  {
    "parent_id": 3333,
    "name": "Category B",
    "id": 2222
  },
  {
    "parent_id": 4444,
    "name": "Category C",
    "id": 3333,
  }
]

and I need write query to select categories in this order based on field parent_id, which points to another category:

Category C > Category B > Category A

Is it possible? Thank you.

Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
  • [Graph Traversal with Streaming Expressions](https://lucene.apache.org/solr/guide/8_1/graph-traversal.html#graph-traversal) is probably your best bet, at least if this hierarchy can be very large .. it'll also depend on what your query is (i.e. what you're starting with). – MatsLindh Aug 06 '19 at 13:45

0 Answers0