3

I'm using Solr to create user-based recommendations. I'm running a solr cloud stream query using the gatherNodes function. The query itself is working fine, but it only returns one field (the itemId). In the end, I'm looking to be able to return multiple fields while still only running one query.

Here is the query:

top(n="10",sort="count(*) desc",
    gatherNodes(checkouts, top(n="30",sort="count(*) desc",
        gatherNodes(checkouts,
            search(checkouts,q="userId:{userId}",fl="itemId",sort="itemId asc", qt="/export"),
            walk="itemId->itemId",gather="userId",
            maxDocFreq="10000",count(*))),
        walk="node->userId",gather="itemId",count(*)))

This returns data in this form:

{
  "result-set": {
      "docs": [
        {
          "node": "item123",
          "count(*)": 5,
          "collection": "checkouts",
          "field": "itemId",
          "level": 2
        }
}

But I'm looking to get more info, such as the title, out of the solr document as well.

Is there another function I could wrap around this function that would be able to retrieve multiple other fields from the document, or another feature of the gatherNodes function that I've missed that would return other fields as well?

Benya16
  • 177
  • 1
  • 15

0 Answers0