Hello,

Just to clarify, do you have LogAttribute with the "Log Payload" property
to true?

If the actual output of LogAttribute is
/[*docid*="95663ced-6a3b-4356-877a-7c5707c046e7_779"]/
then that is not a valid JSON document.

You would need the content of the flow file to be something like the
following:

{
  "docid" : "95663ced-6a3b-4356-877a-7c5707c046e7_779"
}

Can you verify that the payload is a valid JSON document like the one above
and then we can go from there.

Thanks,

Bryan


On Wed, Apr 20, 2016 at 1:26 PM, dale.chang13 <dale.chan...@outlook.com>
wrote:

> While using PutSolrContentStream to store a JSON object in SolrCloud, I've
> been running into this issue of being unable to store a document. I've
> uploaded a solr schema that says that the field *docid* is required and a
> string. Attempting to store a document in solr, this is the error I get:
>
> Failed to send StandardFlowFileRecord[...] to Solr due to due to
> org.apache.solr.client.solrj.SolrServerException:
> org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:
> Error from server at localhost:8983/solr/cobra_shard1_replica3:
> /[*doc*="95663ced-6a3b-4356-877a-7c5707c046e7_779"]/ missing required
> field:
> *docid*; routing to failure:
>
> HOWEVER,
>
> Using LogAttribute to print out the JSON object stored as the FlowFile's
> content and specifically docid, it has a key-value pair
> /[*docid*="95663ced-6a3b-4356-877a-7c5707c046e7_779"]/, which is the same
> string that is printed out in the error from PutSolrContentStream.
>
> My question: /Is there some confusion between the way Nifi uses *doc* and
> the attribute *docid*?/ It referred to the document via
> /[*doc*="95663ced-6a3b-4356-877a-7c5707c046e7_779"]/ after shard3.
>
> Additionally, it looks like replica3 is the only shard that has problem in
> my SolrCloud instance.
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/PutSolrContentStream-Doc-and-DocID-confusion-tp9400.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>

Reply via email to