RE: Solr: Block Join Faceting

2016-08-02 Thread Morse, Matthew K.
Thanks for the response!



1.   So based on my document structure, how can I query on one child 
document but obtain facet counts based on another?  In my example, if my query 
matches only child id=”12”, how can I retrieve facet counts on the other 
children, like fundCode or employeeId for ids 13 and 14?  Have I modeled this 
data correctly in Solr?




1
true

  11
  false
  22
  6


  12
  false
  11
7276


  13
  false
  100419


  14
  false
  245

  



2.   I will try this out.

From: Mikhail Khludnev [mailto:m...@apache.org]
Sent: Tuesday, August 02, 2016 9:37 AM
To: solr-user; Morse, Matthew K.
Subject: Re: Solr: Block Join Faceting



On Wed, Jul 27, 2016 at 5:27 PM, Morse, Matthew K. 
<matthew.k.mo...@fmr.com.invalid<mailto:matthew.k.mo...@fmr.com.invalid>> wrote:

1.With this query I receive no facet results.  The main response is 
correct, but I was expecting to see a fundCode facet of 245 with 1.  Below is 
the query with the output.

 the empty fundCode facets is a feature: the query matches only id=13 child, 
despite it rolls up to parent; thus only this child will contribute to child 
facet, but there is no fundCode value there. I think you need to rethink the 
problem vision, at least w it doesn't comply with child.facet.field


2.   If I change the child facet another field, like an int, it blows up.  
Again I was expecting to see two results for predictiveModelId facet: 11 with 1 
and 22 with 1.

Here I recommend either turn filed to string or enable docValues="true" in 
field declaration. It should help.


Any help would be appreciated!



--
Sincerely yours
Mikhail Khludnev


Solr: Block Join Faceting

2016-07-27 Thread Morse, Matthew K.
Sorry for the double post.


Solr: Block Join Faceting

2016-07-27 Thread Morse, Matthew K.
I have a document with multiple different children.  Below is the structure:

1
true

  11
  false
  22
  6


  12
  false
  11
7276


  13
  false
  100419


  14
  false
  245

  
  
2
true

  15
  false
  92834
  6


  16
  false
  89
345


  17
  false
  64651


  19
  false
  888

  

I am trying to write a query which will return child facets but I am either 
receiving an error or no results.  I'm wondering if someone could point me in 
the right direction.
I am working with Solr 6.1.0.

Here is my schema:


  
  
  
  
  
  


1.With this query I receive no facet results.  The main response is 
correct, but I was expecting to see a fundCode facet of 245 with 1.  Below is 
the query with the output.


... 
/Clients/bjqfacet?fq={!parent%20which=isParent:true}fundCode:245={!parent%20which=isParent:true}predictiveModelId:22={!parent%20which=isParent:true}predictiveModelRank:7276=on={!parent%20which=isParent:true}employeeId:100419=json=fundCode=true



{

  "responseHeader":{

"status":0,

"QTime":2},

  "response":{"numFound":1,"start":0,"docs":[

  {

"id":"7258",

"_version_":1540942803838697474}]

  },

  "facet_counts":[

"facet_fields",[

  "fundCode",[]]],

  "debug":{

"rawquerystring":"{!parent which=isParent:true}employeeId:100419",

"querystring":"{!parent which=isParent:true}employeeId:100419",

"parsedquery":"AllParentsAware(ToParentBlockJoinQuery 
(employeeId:`\u000b\\k\u0017#))",

"parsedquery_toString":"ToParentBlockJoinQuery 
(employeeId:`\u000b\\k\u0017#)",

"explain":{

  "7258":"\n0.0 = Score based on 1 child docs in range from 822434 to 
822469, best match:\n  4.0979195 = weight(employeeId:`\u000b\\k\u0017# in 
822441) [], result of:\n4.0979195 = score(doc=822441,freq=1.0 = 
termFreq=1.0\n), product of:\n  4.0979195 = idf(docFreq=269330, 
docCount=16217701)\n  1.0 = tfNorm, computed from:\n1.0 = 
termFreq=1.0\n1.2 = parameter k1\n0.0 = parameter b (norms 
omitted for field)\n"},

"QParser":"BlockJoinParentQParser",

"filter_queries":["{!parent which=isParent:true}fundCode:245",

  "{!parent which=isParent:true}predictiveModelId:22",

  "{!parent which=isParent:true}predictiveModelRank:7276"],

"parsed_filter_queries":["AllParentsAware(ToParentBlockJoinQuery 
(fundCode:245))",

  "AllParentsAware(ToParentBlockJoinQuery 
(predictiveModelId:`\b\u\u\u\u0016))",

  "AllParentsAware(ToParentBlockJoinQuery 
(predictiveModelRank:`\b\u\u8l))",

  "BlockJoinFacetFilter(null)"],

"timing":{

  "time":2.0,

  "prepare":{

"time":0.0,

"query":{

  "time":0.0},

"facet":{

  "time":0.0},

"facet_module":{

  "time":0.0},

"mlt":{

  "time":0.0},

"highlight":{

  "time":0.0},

"stats":{

  "time":0.0},

"expand":{

  "time":0.0},

"bjqFacetComponent":{

  "time":0.0},

"debug":{

  "time":0.0}},

  "process":{

"time":1.0,

"query":{

  "time":0.0},

"facet":{

  "time":0.0},

"facet_module":{

  "time":0.0},

"mlt":{

  "time":0.0},

"highlight":{

  "time":0.0},

"stats":{

  "time":0.0},

"expand":{

  "time":0.0},

"bjqFacetComponent":{

  "time":0.0},

"debug":{

  "time":0.0}



2.   If I change the child facet another field, like an int, it blows up.  
Again I was expecting to see two results for predictiveModelId facet: 11 with 1 
and 22 with 1.


.../Clients/bjqfacet?fq={!parent%20which=isParent:true}fundCode:245={!parent%20which=isParent:true}predictiveModelId:22={!parent%20which=isParent:true}predictiveModelRank:7276=on={!parent%20which=isParent:true}employeeId:100419=json=predictiveModelId=true



{

  "responseHeader":{

"status":500,

"QTime":1},

  "error":{

"msg":"unexpected docvalues type NUMERIC for field 'predictiveModelId' 
(expected one of [SORTED, SORTED_SET]). Use UninvertingReader or index with 
docvalues.",

"trace":"java.lang.IllegalStateException: unexpected docvalues type NUMERIC 
for field 'predictiveModelId' (expected one of [SORTED, SORTED_SET]). Use 
UninvertingReader or index with docvalues.\n\tat 
org.apache.lucene.index.DocValues.checkField(DocValues.java:212)\n\tat 
org.apache.lucene.index.DocValues.getSortedSet(DocValues.java:306)\n\tat 
org.apache.solr.search.join.BlockJoinFieldFacetAccumulator.initSegmentData(BlockJoinFieldFacetAccumulator.java:77)\n\tat