Context: Cassandra is my datastore and started the node with -s (Solr). I have Solr index created on few columns of one column family and they were all working fine.
Problem: Recently I added a column "m-type" in the same column family and added it to the solr schema.xml with indexed=true and stored=true. When I add this column to solr query through solr admin, I do not get the search result (for ex: age:36 AND name:xyz AND m-type:Buyer). CQl query (select * from MyCF where solr_query='age:12 AND name:xyz' AND m-type:abc;) gives an error: Bad Request: line 1:74 mismatched input '-' expecting set null.
Any help, appreciated,
CQL error message:mismatched input '-' expecting set null
(8 posts) (3 voices)-
Posted 1 year ago #
-
It looks like you meant to put the "AND m-type:abc" part inside the solr query string, but it is outside.
Posted 1 year ago # -
Sorry, that was an incorrect cql. What I wanted to try was
select * from MyCF where solr_query='age:12 AND m-type:abc AND name:xyz;Posted 1 year ago # -
Seems like you forgot to put a closing quote in your query select * from MyCF where solr_query='age:12 AND m-type:abc AND name:xyz';
Posted 1 year ago # -
Thanks for catching my silly mistakes. But I am still with my original problem. Do anyone know, Is it possible to do a solr search on a column name with "-" in it (as mentioned in my example, m-type)?
Posted 1 year ago # -
I have tried running your query on DSE 2.0 with Solr enabled and didn't get parser error when I have correctly placed quotes e.g. solr_query='age:12 AND m-type:abc AND name:xyz' but indeed when I do solr_query='age:12 AND name:xyz' AND m-type:abc I get "Bad Request: line 1:74 mismatched input '-' expecting set null" and in your original comment you have closing quote *before* AND m-type:abc;
Posted 1 year ago # -
I am not sure whats exactly going wrong in my server? Anyway thanks for helping me out.
This is the error I am seeing on the admin. I hope you would have renamed the index somehow. Could you share if you have done anything like that. Thanks again.HTTP Status 500 - java.lang.RuntimeException: java.io.IOException: InvalidRequestException(why:Illegal index name MyKeyspace_MyCF_m-type_index) java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: InvalidRequestException(why:Illegal index name MyKeyspace_MyCF_m-type_index) at com.datastax.bdp.plugin.AbstractPlugin.activate(AbstractPlugin.java:47) at org.apache.solr.core.CassandraCoreContainer.getContainer(CassandraCoreContainer.java:254) at org.apache.solr.core.CassandraCoreContainer.getCore(CassandraCoreContainer.java:179) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:189) at ...
Posted 1 year ago # -
No I didn't, I just ran the query to make sure that it parsed correctly which actually can be done without adding any indexes. But as I look at the Cassandra code right now, it doesn't actually allow index names with '-' inside, unfortunately you would have to rename your column to "mtype" or "m_type"...
Posted 1 year ago #
Reply
You must log in to post.
