You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Steven Novotny <sn...@gmail.com> on 2021/03/08 18:11:32 UTC

solr.CurrencyFieldType not fully replicating it's sub-fields

Hi Everyone,

We currently have a Solr 7.7.2 solrcloud setup (been meaning to update, but
here we are).  Our collections are 2 shards with 2 replicas.  I'm not sure
how long this has been going on exactly, but we recently added a feature to
be able to query on one of the fields of solr.CurrencyFieldType which has
brought this issue up.  It appears that somehow some of our replicas do not
always build (or receive) the sub-fields required to correctly query on the
currency.

We're using the basic example in our schema as outlined in the docs:

  <fieldType name="currency" class="solr.CurrencyFieldType"
currencyConfig="currency.xml" amountLongSuffix="_l_ns"
codeStrSuffix="_s_ns" defaultCurrency="USD"/>
  <dynamicField name="*_s_ns" type="string" indexed="true" stored="false"/>
  <dynamicField name="*_l_ns" type="plong" indexed="true" stored="false"/>
  <dynamicField name="*_c" type="currency" indexed="true" stored="true"/>

For example, here is a query, with debug on that properly returns those
fields:

{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":3,
    "params":{
      "q":"id: \"SaccAccount:1122\"",

"fl":"total_balance_c,total_balance_c____s_ns,total_balance_c____l_ns",
      "debugQuery":"on"}},
  "response":{"numFound":1,"start":0,"maxScore":10.844471,"docs":[
      {
        "total_balance_c":"255.0,USD",
        "total_balance_c____l_ns":25500,
        "total_balance_c____s_ns":"USD"}]
  },
  "debug":{
    "track":{
      "rid":"solr1.example.com-customer_shard2_replica_n3-1615226174296-63",
      "EXECUTE_QUERY":{
        "
http://solr4.example.com:8080/solr/customer_shard1_replica_n1/|http://solr3.example.com:8080/solr/customer_shard1_replica_n2/
":{
          "QTime":"0",
          "ElapsedTime":"0",
          "RequestPurpose":"GET_TOP_IDS",
          "NumFound":"0",

"Response":"{responseHeader={zkConnected=true,status=0,QTime=0,params={df=_text_,distrib=false,debug=[false,
timing, track],fl=[id,
score],shards.purpose=4,start=0,fsv=true,q.op=AND,shard.url=
http://solr4.example.com:8080/solr/customer_shard1_replica_n1/|http://solr3.example.com:8080/solr/customer_shard1_replica_n2/,rows=10,rid=solr1.example.com-customer_shard2_replica_n3-1615226174296-63,version=2,q=id:
\"SaccAccount:1122\",requestPurpose=GET_TOP_IDS,NOW=1615226174296,isShard=true,wt=javabin,debugQuery=false}},response={numFound=0,start=0,maxScore=0.0,docs=[]},sort_values={},debug={timing={time=0.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},terms={time=0.0},debug={time=0.0}},process={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},terms={time=0.0},debug={time=0.0}}}}}"},
        "
http://solr5.example.com:8080/solr/customer_shard2_replica_n5/|http://solr1.example.com:8080/solr/customer_shard2_replica_n3/
":{
          "QTime":"0",
          "ElapsedTime":"1",
          "RequestPurpose":"GET_TOP_IDS",
          "NumFound":"1",

"Response":"{responseHeader={zkConnected=true,status=0,QTime=0,params={df=_text_,distrib=false,debug=[false,
timing, track],fl=[id,
score],shards.purpose=4,start=0,fsv=true,q.op=AND,shard.url=
http://solr5.example.com:8080/solr/customer_shard2_replica_n5/|http://solr1.example.com:8080/solr/customer_shard2_replica_n3/,rows=10,rid=solr1.example.com-customer_shard2_replica_n3-1615226174296-63,version=2,q=id:
\"SaccAccount:1122\",requestPurpose=GET_TOP_IDS,NOW=1615226174296,isShard=true,wt=javabin,debugQuery=false}},response={numFound=1,start=0,maxScore=10.844471,docs=[SolrDocument{id=SaccAccount:1122,
score=10.844471}]},sort_values={},debug={timing={time=0.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},terms={time=0.0},debug={time=0.0}},process={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},terms={time=0.0},debug={time=0.0}}}}}"}},
      "GET_FIELDS":{
        "
http://solr5.example.com:8080/solr/customer_shard2_replica_n5/|http://solr1.example.com:8080/solr/customer_shard2_replica_n3/
":{
          "QTime":"0",
          "ElapsedTime":"1",
          "RequestPurpose":"GET_FIELDS,GET_DEBUG",
          "NumFound":"1",

"Response":"{responseHeader={zkConnected=true,status=0,QTime=0,params={df=_text_,distrib=false,debug=[timing,
track],fl=[total_balance_c,total_balance_c____s_ns,total_balance_c____l_ns,
id],shards.purpose=320,q.op=AND,shard.url=
http://solr5.example.com:8080/solr/customer_shard2_replica_n5/|http://solr1.example.com:8080/solr/customer_shard2_replica_n3/,rows=10,rid=solr1.example.com-customer_shard2_replica_n3-1615226174296-63,version=2,q=id:
\"SaccAccount:1122\",requestPurpose=GET_FIELDS,GET_DEBUG,NOW=1615226174296,ids=SaccAccount:1122,isShard=true,wt=javabin,debugQuery=true}},response={numFound=1,start=0,docs=[SolrDocument{total_balance_c=255.0,USD,
total_balance_c____l_ns=25500,
total_balance_c____s_ns=USD}]},debug={rawquerystring=id:
\"SaccAccount:1122\",querystring=id:
\"SaccAccount:1122\",parsedquery=+id:SaccAccount:1122,parsedquery_toString=+id:SaccAccount:1122,explain={SaccAccount:1122=\n10.844471
= weight(id:SaccAccount:1122 in 4833) [SchemaSimilarity], result of:\n
 10.844471 = score(doc=4833,freq=1.0 = termFreq=1.0\n), product of:\n
 10.844471 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
+ 0.5)) from:\n      3.0 = docFreq\n      179374.0 = docCount\n    1.0 =
tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n      1.0 =
termFreq=1.0\n      1.2 = parameter k1\n      0.0 = parameter b (norms
omitted for
field)\n},QParser=LuceneQParser,timing={time=0.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},terms={time=0.0},debug={time=0.0}},process={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},terms={time=0.0},debug={time=0.0}}}}}"}}},
    "timing":{
      "time":0.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},
        "terms":{
          "time":0.0},
        "debug":{
          "time":0.0}},
      "process":{
        "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},
        "terms":{
          "time":0.0},
        "debug":{
          "time":0.0}}},
    "rawquerystring":"id: \"SaccAccount:1122\"",
    "querystring":"id: \"SaccAccount:1122\"",
    "parsedquery":"+id:SaccAccount:1122",
    "parsedquery_toString":"+id:SaccAccount:1122",
    "QParser":"LuceneQParser",
    "explain":{
      "SaccAccount:1122":"\n10.844471 = weight(id:SaccAccount:1122 in 4833)
[SchemaSimilarity], result of:\n  10.844471 = score(doc=4833,freq=1.0 =
termFreq=1.0\n), product of:\n    10.844471 = idf, computed as log(1 +
(docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n      3.0 = docFreq\n
     179374.0 = docCount\n    1.0 = tfNorm, computed as (freq * (k1 + 1)) /
(freq + k1) from:\n      1.0 = termFreq=1.0\n      1.2 = parameter k1\n
 0.0 = parameter b (norms omitted for field)\n"}}}

Here is the same query where they seem to just be completely missing from
the response:

{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":2,
    "params":{
      "q":"id: \"SaccAccount:1122\"",

"fl":"total_balance_c,total_balance_c____s_ns,total_balance_c____l_ns",
      "debugQuery":"on"}},
  "response":{"numFound":1,"start":0,"maxScore":11.1389885,"docs":[
      {
        "total_balance_c":"255.0,USD"}]
  },
  "debug":{
    "track":{
      "rid":"solr1.example.com-customer_shard2_replica_n3-1615225795826-62",
      "EXECUTE_QUERY":{
        "
http://solr1.example.com:8080/solr/customer_shard2_replica_n3/|http://solr5.example.com:8080/solr/customer_shard2_replica_n5/
":{
          "QTime":"0",
          "ElapsedTime":"0",
          "RequestPurpose":"GET_TOP_IDS",
          "NumFound":"1",

"Response":"{responseHeader={zkConnected=true,status=0,QTime=0,params={df=_text_,distrib=false,debug=[false,
timing, track],fl=[id,
score],shards.purpose=4,start=0,fsv=true,q.op=AND,shard.url=
http://solr1.example.com:8080/solr/customer_shard2_replica_n3/|http://solr5.example.com:8080/solr/customer_shard2_replica_n5/,rows=10,rid=solr1.example.com-customer_shard2_replica_n3-1615225795826-62,version=2,q=id:
\"SaccAccount:1122\",requestPurpose=GET_TOP_IDS,NOW=1615225795826,isShard=true,wt=javabin,debugQuery=false}},response={numFound=1,start=0,maxScore=11.1389885,docs=[SolrDocument{id=SaccAccount:1122,
score=11.1389885}]},sort_values={},debug={timing={time=0.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},terms={time=0.0},debug={time=0.0}},process={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},terms={time=0.0},debug={time=0.0}}}}}"},
        "
http://solr3.example.com:8080/solr/customer_shard1_replica_n2/|http://solr4.example.com:8080/solr/customer_shard1_replica_n1/
":{
          "QTime":"0",
          "ElapsedTime":"0",
          "RequestPurpose":"GET_TOP_IDS",
          "NumFound":"0",

"Response":"{responseHeader={zkConnected=true,status=0,QTime=0,params={df=_text_,distrib=false,debug=[false,
timing, track],fl=[id,
score],shards.purpose=4,start=0,fsv=true,q.op=AND,shard.url=
http://solr3.example.com:8080/solr/customer_shard1_replica_n2/|http://solr4.example.com:8080/solr/customer_shard1_replica_n1/,rows=10,rid=solr1.example.com-customer_shard2_replica_n3-1615225795826-62,version=2,q=id:
\"SaccAccount:1122\",requestPurpose=GET_TOP_IDS,NOW=1615225795826,isShard=true,wt=javabin,debugQuery=false}},response={numFound=0,start=0,maxScore=0.0,docs=[]},sort_values={},debug={timing={time=0.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},terms={time=0.0},debug={time=0.0}},process={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},terms={time=0.0},debug={time=0.0}}}}}"}},
      "GET_FIELDS":{
        "
http://solr1.example.com:8080/solr/customer_shard2_replica_n3/|http://solr5.example.com:8080/solr/customer_shard2_replica_n5/
":{
          "QTime":"0",
          "ElapsedTime":"0",
          "RequestPurpose":"GET_FIELDS,GET_DEBUG",
          "NumFound":"1",

"Response":"{responseHeader={zkConnected=true,status=0,QTime=0,params={df=_text_,distrib=false,debug=[timing,
track],fl=[total_balance_c,total_balance_c____s_ns,total_balance_c____l_ns,
id],shards.purpose=320,q.op=AND,shard.url=
http://solr1.example.com:8080/solr/customer_shard2_replica_n3/|http://solr5.example.com:8080/solr/customer_shard2_replica_n5/,rows=10,rid=solr1.example.com-customer_shard2_replica_n3-1615225795826-62,version=2,q=id:
\"SaccAccount:1122\",requestPurpose=GET_FIELDS,GET_DEBUG,NOW=1615225795826,ids=SaccAccount:1122,isShard=true,wt=javabin,debugQuery=true}},response={numFound=1,start=0,docs=[SolrDocument{total_balance_c=255.0,USD}]},debug={rawquerystring=id:
\"SaccAccount:1122\",querystring=id:
\"SaccAccount:1122\",parsedquery=+id:SaccAccount:1122,parsedquery_toString=+id:SaccAccount:1122,explain={SaccAccount:1122=\n11.1389885
= weight(id:SaccAccount:1122 in 7541) [SchemaSimilarity], result of:\n
 11.1389885 = score(doc=7541,freq=1.0 = termFreq=1.0\n), product of:\n
 11.1389885 = idf, computed as log(1 + (docCount - docFreq + 0.5) /
(docFreq + 0.5)) from:\n      2.0 = docFreq\n      172004.0 = docCount\n
 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n      1.0
= termFreq=1.0\n      1.2 = parameter k1\n      0.0 = parameter b (norms
omitted for
field)\n},QParser=LuceneQParser,timing={time=0.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},terms={time=0.0},debug={time=0.0}},process={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},terms={time=0.0},debug={time=0.0}}}}}"}}},
    "timing":{
      "time":0.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},
        "terms":{
          "time":0.0},
        "debug":{
          "time":0.0}},
      "process":{
        "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},
        "terms":{
          "time":0.0},
        "debug":{
          "time":0.0}}},
    "rawquerystring":"id: \"SaccAccount:1122\"",
    "querystring":"id: \"SaccAccount:1122\"",
    "parsedquery":"+id:SaccAccount:1122",
    "parsedquery_toString":"+id:SaccAccount:1122",
    "QParser":"LuceneQParser",
    "explain":{
      "SaccAccount:1122":"\n11.1389885 = weight(id:SaccAccount:1122 in
7541) [SchemaSimilarity], result of:\n  11.1389885 =
score(doc=7541,freq=1.0 = termFreq=1.0\n), product of:\n    11.1389885 =
idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5))
from:\n      2.0 = docFreq\n      172004.0 = docCount\n    1.0 = tfNorm,
computed as (freq * (k1 + 1)) / (freq + k1) from:\n      1.0 =
termFreq=1.0\n      1.2 = parameter k1\n      0.0 = parameter b (norms
omitted for field)\n"}}}


Typically we can resolve this by issuing a delete by the ID and then
sending the record again for indexing.  Eventually it will get out of sync
again though and we're not entirely sure how or why.  I'm curious if anyone
has any ideas on things to try or what might be going on?

Thanks,
Steven