Hi Mikhail,
  Sorry I didn’t reply sooner
 
Here are some example docs - each document for a userAccount object has 1
or more nested documents for our userLinkedAccount object

SolrInputDocument(fields: [type=userAccount,
typeId=userAccount/HERE-8ce41333-7c08-40d3-9b2c-REDACTED,
id=userAccount/HERE-8ce41333-7c08-40d3-9b2c-REDACTED,
emailAddress=[redac...@here.com, REDACTED here.com], nameSort=�,
emailType=Primary, familyName=REDACTED, allText=[REDACTED, REDACTED ,
untokenized=[REDACTED, REDACTED , isEnabled=1,
createdTimeNumeric=1406972278682,
haAccountId=HERE-8ce41333-7c08-40d3-9b2c-REDACTED, givenName=REDACTED,
readAccess=application, indexTime=1488828050933])
SolrInputDocument(fields: [type=userLinkedAccount,
typeId=userLinkedAccount/5926990ea0708fa82c9ddca5d1bda6ed3331a450,
id=userLinkedAccount/5926990ea0708fa82c9ddca5d1bda6ed3331a450,
haAccountId=HERE-8ce41333-7c08-40d3-9b2c-REDACTED, nameSort=�,
hereRealm=HERE, haAccountType=password, haUserId= redac...@here.com,
readAccess=application, createdTimeNumeric=1406972278646,
indexTime=1488828050933])

SolrInputDocument(fields: [type=userAccount,
typeId=userAccount/HERE-4797487f-7659-4c58-80b5-REDACTED,
id=userAccount/HERE-4797487f-7659-4c58-80b5-REDACTED,
emailAddress=[redac...@live.de, redac...@live.de], nameSort=�,
emailType=Primary, familyName= REDACTED, allText=[REDACTED, REDACTED],
untokenized=[REDACTED, REDACTED], isEnabled=1,
createdTimeNumeric=1447141199050,
haAccountId=HERE-4797487f-7659-4c58-80b5-REDACTED, givenName=Krzysztof,
readAccess=application, indexTime=1488828050941])
SolrInputDocument(fields: [type=userLinkedAccount,
typeId=userLinkedAccount/02d11e8096dc4727ee7c2c4f6cc4723190620088,
id=userLinkedAccount/02d11e8096dc4727ee7c2c4f6cc4723190620088,
haAccountId=HERE-4797487f-7659-4c58-80b5-REDACTED, nameSort=�,
hereRealm=HERE, haAccountType=password, haUserId=redac...@live.de,
readAccess=application, createdTimeNumeric=1447141199009,
indexTime=1488828050941])

SolrInputDocument(fields: [type=userAccount,
typeId=userAccount/HERE-8ce41333-7c08-40d3-9b2c-REDACTED,
id=userAccount/HERE-8ce41333-7c08-40d3-9b2c-REDACTED,
emailAddress=[redac...@here.com, REDACTED here.com], nameSort=�,
emailType=Primary, familyName= REDACTED, allText=[REDACTED, REDACTED],
untokenized=[REDACTED, REDACTED], isEnabled=1,
createdTimeNumeric=1406972278682,
haAccountId=HERE-8ce41333-7c08-40d3-9b2c-REDACTED, givenName= REDACTED,
readAccess=application, indexTime=1488828051697])
SolrInputDocument(fields: [type=userLinkedAccount,
typeId=userLinkedAccount/5926990ea0708fa82c9ddca5d1bda6ed3331a450,
id=userLinkedAccount/5926990ea0708fa82c9ddca5d1bda6ed3331a450,
haAccountId=HERE-8ce41333-7c08-40d3-9b2c-REDACTED, nameSort=�,
hereRealm=HERE, haAccountType=password, haUserId= redac...@here.com,
readAccess=application, createdTimeNumeric=1406972278646,
indexTime=1488828051697])


So we often want to
FIND userLinkedAccount document WHERE parentDocument has some filter
properties e.g. Name / email address
E.g.

+type:userLinkedAccount +{!child of="type:userAccount"
v="givenName:frank*”}

The results appear to come back fine but the numFound often has a small
delta we cannot explain

Here is the output of the debugQuery

"rawquerystring": "+type:userLinkedAccount +{!child
of=\"type:userAccount\" v=\"givenName:frank*\"}",
    "querystring": "+type:userLinkedAccount +{!child
of=\"type:userAccount\" v=\"givenName:frank*\"}",
    "parsedquery": "+type:userLinkedAccount
+ToChildBlockJoinQuery(ToChildBlockJoinQuery (givenName:frank*))",
    "parsedquery_toString": "+type:userLinkedAccount
+ToChildBlockJoinQuery (givenName:frank*)",
    "QParser": "LuceneQParser",
    "explain": {
      "userLinkedAccount/eb86bc13944094ce16f684a7f58e2294c84ca956":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
84623) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=84623,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 84623,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=84623)\n  0.5168401 = Score
based on parent document 84624\n    0.5168401 = givenName:frank*, product
of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/78498d9d7d5c1a52de0f61d90df138ac7381d37f":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
113884) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=113884,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 113884,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=113884)\n  0.5168401 =
Score based on parent document 113885\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/bbe5d001555d9df20a758855c10ad1ca4e96fcec":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
121675) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=121675,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 121675,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=121675)\n  0.5168401 =
Score based on parent document 121676\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/fe18b9edb1a2cf54676ec91b098b619ea544e511":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
136439) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=136439,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 136439,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=136439)\n  0.5168401 =
Score based on parent document 136440\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/45340d743fcc85897b315f3fdf223da955985d48":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
140593) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=140593,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 140593,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=140593)\n  0.5168401 =
Score based on parent document 140594\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/a158e59fed8f59b8d6cd065d083fa4b5ef7e1145":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
186273) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=186273,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 186273,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=186273)\n  0.5168401 =
Score based on parent document 186274\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/25bd6f4a13aec22b8060e289a9f7d1be1b108b12":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
188712) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=188712,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 188712,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=188712)\n  0.5168401 =
Score based on parent document 188713\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/a3c562919a134e2f2da8efbc9f230f3aa16f45f1":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
195914) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=195914,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 195914,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=195914)\n  0.5168401 =
Score based on parent document 195915\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/b7b778a2abe5137d899ee501d2638a09c3aecaf2":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
204905) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=204905,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 204905,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=204905)\n  0.5168401 =
Score based on parent document 204906\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n",
      "userLinkedAccount/1910d517c1804e81030f1c9fe58a0f687d0bdf3f":
"\n1.9348345 = sum of:\n  1.4179944 = weight(type:userLinkedAccount in
210691) [DefaultSimilarity], result of:\n    1.4179944 =
score(doc=210691,freq=1.0), product of:\n      0.85608196 = queryWeight,
product of:\n        1.6563768 = idf(docFreq=14190942, maxDocs=27357228)\n
       0.5168401 = queryNorm\n      1.6563768 = fieldWeight in 210691,
product of:\n        1.0 = tf(freq=1.0), with freq of:\n          1.0 =
termFreq=1.0\n        1.6563768 = idf(docFreq=14190942,
maxDocs=27357228)\n        1.0 = fieldNorm(doc=210691)\n  0.5168401 =
Score based on parent document 210692\n    0.5168401 = givenName:frank*,
product of:\n      1.0 = boost\n      0.5168401 = queryNorm\n"
    }


Here are some relevant (but not all) fields from our Schema.xml

<field name="givenName" type="text_general" indexed="true" stored="false"/>
        <field name="type" type="string" indexed="true" stored="false"/>
        <field name="haAccountId" type="string" indexed="true" stored="false"/>
        <field name="emailAddress" type="email_general" indexed="true"
stored="false" multiValued="true"/>


Please let me know if you need any more info,

-Frank

P.s. Due to https://issues.apache.org/jira/browse/SOLR-5772
We always create, update and delete nested objects together



On 3/2/17, 3:42 PM, "Mikhail Khludnev" <m...@apache.org> wrote:

>Hello, Frank!
>
>The closest equivalent would be  q=+type:userAccount +givenName:test*
>And make sure please that it's parsed correctly with debugQuery=true.
>Can you also narrow the query to troubleshoot the difference?
>ahhh I probably understood.. shards results are merged by uniqueKey, can
>you share your schema and sample docs?
>
>On Thu, Mar 2, 2017 at 5:53 PM, Kelly, Frank <frank.ke...@here.com> wrote:
>
>> This is Solr Cloud 5.3.1
>>
>> I have a query like the following
>> q={!child of="type:userAccount" v="givenName:test*”}
>>
>> Intent: Show me all children of the type:userAccount where
>> userAccount.givenName:test*
>>
>> If I run the query multiple times I get a very different numFound
>> difference 186,560 to 187,412 (+/0 500).
>>
>> If I run the “normal” query on just the  parents
>> q=type:userAccount givenName:test*
>>
>> I get a very stable numFound
>>
>> Reading the docs it’s not documented as supported but neither do I get
>>an
>> error
>> 
>>https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.
>>apache.org%2Fconfluence%2Fdisplay%2Fsolr%2FOther%2BParsers&data=01%7C01%7
>>C%7C59db5fc24ce0477fa2c308d461acb3f4%7C6d4034cd72254f72b85391feaea64919%7
>>C1&sdata=Q1JVc3%2FAMhtpq2NNsGsv0mMho1s4S3467x3OrkUckFc%3D&reserved=0
>>
>> Am I using nestedQueries correctly?
>>
>> -Frank
>>
>>
>>
>>
>> [image: Description: Macintosh
>> 
>>HD:Users:jerchow:Downloads:Asset_Package_01_160721:HERE_Logo_2016:sRGB:PD
>>F:HERE_Logo_2016_POS_sRGB.pdf]
>>
>>
>>
>> *Frank Kelly*
>>
>> *Principal Software Engineer*
>>
>> Identity Profile Team (SCBE, Traces, CDA)
>>
>>
>> HERE
>>
>> 5 Wayside Rd, Burlington, MA 01803, USA
>>
>> *42° 29' 7" N 71° 11' 32" W*
>>
>>
>> [image: Description:
>> 
>>/Users/nussbaum/_WORK/PROJECTS/20160726_HERE_EMail_Signature/_Layout/_Ima
>>ges/20160726_HERE_EMail_Signature_360.gif]
>> 
>><https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2F360.he
>>re.com%2F&data=01%7C01%7C%7C59db5fc24ce0477fa2c308d461acb3f4%7C6d4034cd72
>>254f72b85391feaea64919%7C1&sdata=FwqXte%2FmIggfhdcBsXIRO7ZL0MTkhzXv%2Fwbw
>>Wq0WT0g%3D&reserved=0>    [image: Description:
>> 
>>/Users/nussbaum/_WORK/PROJECTS/20160726_HERE_EMail_Signature/_Layout/_Ima
>>ges/20160726_HERE_EMail_Signature_Twitter.gif]
>> 
>><https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.t
>>witter.com%2Fhere&data=01%7C01%7C%7C59db5fc24ce0477fa2c308d461acb3f4%7C6d
>>4034cd72254f72b85391feaea64919%7C1&sdata=SIza6p83uU9sPe7ilGru2RcpE1qsMtDG
>>g%2FL4l2J5D6k%3D&reserved=0>   [image: Description:
>> 
>>/Users/nussbaum/_WORK/PROJECTS/20160726_HERE_EMail_Signature/_Layout/_Ima
>>ges/20160726_HERE_EMail_Signature_FB.gif]
>> 
>><https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.f
>>acebook.com%2Fhere&data=01%7C01%7C%7C59db5fc24ce0477fa2c308d461acb3f4%7C6
>>d4034cd72254f72b85391feaea64919%7C1&sdata=5t3%2Fo3EXPR6mLKGxR96XG7XUwlOwP
>>1GV%2BDYRmV1t3rU%3D&reserved=0>    [image: Description:
>> 
>>/Users/nussbaum/_WORK/PROJECTS/20160726_HERE_EMail_Signature/_Layout/_Ima
>>ges/20160726_HERE_EMail_Signature_IN.gif]
>> 
>><https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.l
>>inkedin.com%2Fcompany%2Fheremaps&data=01%7C01%7C%7C59db5fc24ce0477fa2c308
>>d461acb3f4%7C6d4034cd72254f72b85391feaea64919%7C1&sdata=23tw%2FBT5K78fKvS
>>J9lo6l0%2B5Sd8fQZhvz%2BkfiXYNVe0%3D&reserved=0>    [image: Description:
>> 
>>/Users/nussbaum/_WORK/PROJECTS/20160726_HERE_EMail_Signature/_Layout/_Ima
>>ges/20160726_HERE_EMail_Signature_Insta.gif]
>> 
>><https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.i
>>nstagram.com%2Fhere%2F&data=01%7C01%7C%7C59db5fc24ce0477fa2c308d461acb3f4
>>%7C6d4034cd72254f72b85391feaea64919%7C1&sdata=wOFmnb6b%2BLRILvkPTqxlMKHj0
>>SNl6kEfSiyiRtlX3wk%3D&reserved=0>
>>
>
>
>
>-- 
>Sincerely yours
>Mikhail Khludnev

Reply via email to