schema.xml
<schema name="initialtiny" version="1.1">
<types>
<fieldType name="string" class="solr.StrField"/>
<fieldType name="text" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
</analyzer>
</fieldType>
<fieldType name="uuid" class="solr.UUIDField" multiValued="false"/>
</types>
<fields>
<field name="id" type="uuid" indexed="true" stored="true"/>
<field name="body" type="text" indexed="true" stored="true"/>
</fields>
<defaultSearchField>body</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
solrconfig.xml (the request handler part)
<requestHandler name="/update/json"
class="solr.JsonUpdateRequestHandler" />
Once these are posted and column families and such are created, this is the end of the output from cassandra-cli describe initialtiny; (this will be relevant further down)
...
Column Name: body
Validation Class: org.apache.cassandra.db.marshal.UTF8Type
Index Name: initialtiny3_solr_body_index
Index Type: CUSTOM
Index Options: {class_name=com.datastax.bdp.cassandra.index.solr.SolrSecondaryIndex}
Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
Compression Options:
sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor
So, all good so far. I can also view this in OpsCenter, and see that column family was created, etc.
When I attempt to add a document for indexing, via:
curl http://localhost:8983/solr/resource/initialtiny.solr/update/json?commit=true -H 'Content-Type:application/json' -d '{"id":"aecfd710-5b64-11e2-bcfd-0800205c9a67","body":"This is my awesome text. I hope it gets indexed"}' -v
It returns SUCCESS. However, no data is stored in Cassandra, and searching for *:* returns 0 results.
What's odd is that running describe initialtiny; within cassandra-cli displays the following at the end:
...
Column Name: body
Validation Class: org.apache.cassandra.db.marshal.UTF8Type
Index Name: initialtiny2_solr_body_index
Index Type: CUSTOM
Index Options: {class_name=com.datastax.bdp.cassandra.index.solr.SolrSecondaryIndex}
Column Name: _solr_update/json
Validation Class: org.apache.cassandra.db.marshal.UTF8Type
Index Name: solr__solr_updatejson_idx_2
Index Type: CUSTOM
Index Options: {class_name=com.datastax.bdp.util.ConfigOnlyIndex, update/json={"id":"aecfd710-5b64-11e2-bcfd-0800205c9a67","body":"This is my awesome text. I hope it gets indexed"}
}
Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
Compression Options:
sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor
I was expecting that a document I POSTed would be indexed, and then added to Cassandra datastore.
What happened was that the document was not added to Cassandra datastore and querying for *:* results in 0 results.
Additionally, the document I posted ends up as Index Options field in column _solr_update/json for some reason.
How do I add documents to be indexed and stored by POSTing JSON to Solr?
