Nick
Nick

Reputation: 21

Solr - Boosting parent documents based on child document field

I am trying to figure out how to boost my parent documents based on the values within a sub-document. I am currently using Solr 5.3 and everything is indexed correctly. Here is the document structure I'm working with:

{
  id : 1
  type_s : "Product",
  productId : 1,
  _children_ : [
    {
      id : 2,
      type_s : "Store",
      storeId : 100,
      price_p : 10.99,
      availability_s : "PICKUP"
    },
    {
      id : 3,
      type_s : "Store",
      storeId : 101,
      price_p : 11.99,
      availability_s : "DELIVERY"
    }
  ]
}

I have been able to do all the filtering and faceting on sub-documents, but I can't figure out the boosting. I've tried doing joins within bq like the following with no luck:

bq={!parent which='type_s:Product'} availability_s:DELIVERY^2.0

In addition, how would I boost based on the value of price_p?

I have not been able to find any documentation on this, so if anyone has boosted based on sub-documents, any help would be appreciated!

Upvotes: 1

Views: 692

Answers (1)

Navin Kulkarni
Navin Kulkarni

Reputation: 11

Provide score mode and try. Something like this: bq={!parent which="type_s:Product" score=total}availability_s:DELIVERY^2.0

More information about score mode:http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/search/join/ScoreMode.html

Upvotes: 1

Related Questions