0
votes

I have a solr schema related to a table created on Datastax. I know that the datastax containing the whole documents so, I created the solr schema without storing the fields on it, only the stored field is the ID field.

We used CQL to retrieve the documents from datastax using "solr_query". But can I retrieve the documents from solr API directly in case of the fields are not stored?

UPDATE 1

//Create keyspace

CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' :'NetworkTopologyStrategy', 'Cassandra' : 3, 'Solr' : 2 };

//Create table

create table mytable( id uuid ,name text ,description text ,primary key(id,name) );

//schema fields

<field name="id" type="uuid" indexed="true" stored="true" multiValued="false"  omitNorms="true"  termVectors="true" termPositions="true" termOffsets="true" />

<field name="name" type="text_general" indexed="true" stored="false" multiValued="false"  omitNorms="true"  termVectors="true" termPositions="true" termOffsets="true" />
<field name="description" type="text_general" indexed="true" stored="false" multiValued="false"  omitNorms="true"  termVectors="true" termPositions="true" termOffsets="true" />

//commands to upload configuration to solr

curl localhost:8983/solr/resource/mykeyspace.mytable/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8'

curl localhost:8983/solr/resource/mykeyspace.mytable/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8'

//create collection

curl "localhost:8983/solr/admin/cores?action=CREATE&name=mykeyspace.mytable"

2
You are using DSE correct? Yes you can still pull non indexed fields, you just can't filter by them.phact
I'm already using DSE. I can pull using CQL and filter indexed fields using "solr_query" in CQL. But we can't pull documents using Solr API.M.Almokadem

2 Answers

0
votes

We used CQL to retrieve the documents from datastax using "solr_query". But can I retrieve the documents from solr API directly in case of the fields are not stored?

DSE Search always stores column/field values in Cassandra, regardless of the schema stored attribute (with some exceptions as documented), so the answer to your question is yes, you can retrieve documents using both CQL and HTTP Solr APIs, but keep in mind the former should be preferred as faster most of the time.

0
votes

I've changed the fields to STORED and use the default "/select" handler