SOLR-6304 allows me to send in arbitrary JSON document and have Solr do something reasonable with it. I tried this with a simple tweet and got a weird error:
Here's the tweet I'm trying to index:
The error is because the nested user object within the tweet also has an "id" field. So then I tried to map /user/id to user_id_s via:
So then I added the mapping for id explicitly and it worked:
curl "http://localhost:8983/solr/tutorial/update/json/docs?f=id:/id&f=user_id_s:/user/id" -H 'Content-type:application/json' -d @sample_tweet.json
Working through this wasn't terrible but our goal with features like this is to have Solr make good decisions when possible to ease the new user's burden of getting to know Solr.
I'm just wondering if the reasonable thing to do wouldn't be to map the user fields with user_ prefix? ie /user/id becomes user_id automatically.
Lastly, I wanted to use field guessing with this so my JSON document gets indexed in a reasonable way and the only data that got indexed is:
So I explicitly defined the /update/json/docs request handler in my solrconfig.xml as:
Same result - no field guessing! (this is using the schemaless example config)