2

I have tried to implement the Page and Post relation in single Solr Schema. In my use case each page has multiple posts. Page and Post fields are as follows:

Post:{post_content, owner_page_id, document_type}

Page:{page_id, document_type}

Suppose I want to query this single core for the results sorted by the total number of term frequency for specific term per each Page. First I though the following query can help me to overcome this query requirement for term "hello":

http://localhost:8983/solr/document/select?wt=json&indent=true&fl=id,name&q=*:*&group=true&group.field=owner_page_id&sort=termfreq(post_content,%27hello%27)+desc&fl=result:termfreq(post_content_text,%27hello%27),owner_page_id

But, it seems that this query returns the term frequency for single post of each page and the result is not aggregated for all of the page posts, and I am looking for the aggregate result.

I would be really grateful if somebody can help me to find the required query for my requirement.

P.S: I am using Solr 6, so JSON Facet is available for me.

Ali
  • 1,759
  • 2
  • 32
  • 69

0 Answers0