How do I insert timeseries data into Solr? - solr

I have existing Solr collection named chronix.
ANd I also have configured chronix, but when I issue query on chronix JAVA FX then it is throwing error like this -
2018-06-29 09:30:16.611 INFO (qtp761960786-20) [ x:chronix] o.a.s.c.S.Request [chronix] webapp=/solr path=/select params={q=*:*&fl=%2Bdata&start=0&rows=200&wt=javabin&version=2} status=500 QTime=1
2018-06-29 09:30:16.611 ERROR (qtp761960786-20) [ x:chronix] o.a.s.s.HttpSolrCall null:java.lang.NumberFormatException: For input string: "+"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
What am I missing?

You have a + before the value in your fl parameter. The fl parameter should contain the list of fields you want to retrieve, and having a + here is not a valid field name.
To get the field data back, &fl=data is what you want, not &fl=+data (%2B is the url encoded version of +)

Related

Solr query to Postman's raw data query

This is my Solr query: qt section: /select
q section: -nest_path:*
fl section: *, [child limit=-1]
Solr query
and I wanna convert this to Postman's form-data like " stmt: select id,title from TABLE_NAME where author_code is not null limit 100 " to reach same result.
If you execute your query from the Solr Admin web page you should see the corresponding URL that you will need for Postman at the top of the page
In this case the URL will be:
http://localhost:8983/solr/puldata/select?fl=*%2C%20%5Bchild%20limit%3D-1%5D&q=-nest_path%3A*
I am not sure your query is valid, though. But that would be a different issue.

SolR 6.6.0 : Error 500 when requesting more than 4 facet

I have a 500 error in solR with this query :
q=*&wt=json&rows=0&fq=date:[2014-01-01T09:15:57.000Z/SECOND TO *]&facet=true&facet.field=text&facet.limit=5
I noticed that if put the parameter "facet.limit" to less than 5 it works but otherwise it does not. Here is the stack from SolR :
msg : "Error from server at http://localhost:8983/solr/core_replica1: Exception during facet.field: text"
trace : "org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:
Error from server at http://localhost:8983/solr/core_replica1: Exception during facet.field: text\n\tat
Do you know why this kind of error would happen?
I use Solr 6.6.0.
The field that I request is a org.apache.solr.schema.TextField that is :
Indexed | Tokenized | Stored | TermVector Stored | Store Offset With TermVector | Store Position With TermVector for the properties and shema
Thanks!
EDIT : solr logs :
2018-03-29 15:26:24.137 INFO (qtp42121758-601) [c:core s:shard2 r:core_node1 x:core_shard2_replica1] o.a.s.c.S.Request [core_shard2_replica1]
webapp=/solr path=/select params={facet.field={!terms%3D$text__terms}text&distrib=false&qt=weblab_facet&fl=id,score&shards.purpose=32&text__terms=est&fq=date:
[2014-01-01T09:15:57.000Z/SECOND+TO+*]&shard.url=http://localhost:8983/solr/core_shard2_replica1/&rows=0&version=2&f.mainDate.facet.range.end=NOW/DAY&q=*&facet.limit=5&f.mainDate.facet.range.gap=%2B1DAY&
NOW=1522329984131&isShard=true&facet=true&f.mainDate.facet.range.start=NOW/DAY-5DAYS&wt=javabin&facet.sort=count} hits=5 status=500 QTime=0
2018-03-29 15:26:24.137 ERROR (qtp42121758-601) [c:core s:shard2 r:core_node1 x:core_shard2_replica1] o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: Exception during facet.field: text
at org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
And :
2018-03-29 15:26:24.137 ERROR (qtp42121758-601) [c:core s:shard2 r:core_node1 x:core_shard2_replica1]
o.a.s.h.RequestHandlerBase
org.apache.solr.common.SolrException: Exception during facet.field: text
at org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
Caused by: java.lang.NullPointerException
at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:683)

Getting Issue in Solr Search with DSE

I am using DSE version = 5.0.1 . Using Solr for Search activities. I created core successfully for particular table.
After that once I am trying to execute solr seach query , I am getting below issue :-
cqlsh:tradebees_dev> SELECT * FROM yf_product_books where solr_query = ':';
ServerError: <Error from server: code=0000 [Server error]
message="java.io.IOException:
No shards available for ranges: [(2205014674981121837,2205014674981121837]]">
Please suggest some solutions.
Your query should be something like this : -
SELECT * FROM yf_product_books where solr_query = ':';

How to Update Doc in Cloudant no sql-db

I am following Link to integrate cloudant no sql-db.
There are methods given create DB, Find all, count, search, update. Now I want to update one key value in one of my DB doc file. how Can i achieve that. Document shows like
updateDoc (name, doc)
Arguments:
name - database name
docID - document to update
but when i pass my database name and doc ID its throwing database already created can not create db. But i wanted to updated doc. So can anyone help me out.
Below is one of the doc of may table 'employee_table' for reference -
{
"_id": "0b6459f8d368db408140ddc09bb30d19",
"_rev": "1-6fe6413eef59d0b9c5ab5344dc642bb1",
"Reporting_Manager": "sdasd",
"Designation": "asdasd",
"Access_Level": 2,
"Employee_ID": 123123,
"Employee_Name": "Suhas",
"Project_Name": "asdasd",
"Password": "asda",
"Location": "asdasd",
"Project_Manager": "asdas"
}
So I want to update some values from above doc file of my table 'employee_table'. So what parameters I have to pass to update.
first of all , there is no concept named table in no sql world.
second, to update document first you need to get document based on any input field of document. you can also use Employee_ID or some other document field. then use database.get_query_result
db_name = 'Employee'
database = client.create_database(db_name,throw_on_exists=False)
EmployeeIDValue = '123123'
#here throw_on_exists=False meaning dont throw error if DB already present
def updateDoc (database, EmployeeIDValue):
results = database.get_query_result(
selector= { 'Employee_ID': {'$eq': EmployeeIDValue} }, )
for result in results:
my_doc_id = result["_id"]
my_doc = database[my_doc_id] #===> this give you your document.
'''Now you can do update'''
my_doc['Employee_Name'] = 'XYZ'
my_doc.save() ====> this command updates current document

SOLR failed to create index for Cassandra 2.1.1 list which have user defined data type

I m trying to integrate Cassandra 2.1.1 with SOLR, but SOLR failed to
create index with following error message.
16767 [qtp297774990-12] INFO org.apache.solr.handler.dataimport.DataImporter – Loading DIH Configuration: dataconfigCassandra.xml
16779 [qtp297774990-12] INFO org.apache.solr.handler.dataimport.DataImporter – Data Configuration loaded successfully
16788 [Thread-15] INFO org.apache.solr.handler.dataimport.DataImporter – Starting Full Import
16789 [qtp297774990-12] INFO org.apache.solr.core.SolrCore – [Entity_dev] webapp=/solr path=/dataimport params={optimize=false&indent=true&clean=true&commit=true&verbose=false&command=full-import&debug=false&wt=json} status=0 QTime=27
16810 [qtp297774990-12] INFO org.apache.solr.core.SolrCore – [Entity_dev] webapp=/solr path=/dataimport params={indent=true&command=status&_=1416042006354&wt=json} status=0 QTime=0
16831 [Thread-15] INFO org.apache.solr.handler.dataimport.SimplePropertiesWriter – Read dataimport.properties
16917 [Thread-15] INFO org.apache.solr.search.SolrIndexSearcher – Opening Searcher#6214b0dc[Entity_dev] realtime
16945 [Thread-15] INFO org.apache.solr.handler.dataimport.JdbcDataSource – Creating a connection for entity Entity with URL: jdbc:cassandra://10.234.31.153:9160/galaxy_dev
17082 [Thread-15] INFO org.apache.solr.handler.dataimport.JdbcDataSource – Time taken for getConnection(): 136
17429 [Thread-15] ERROR org.apache.solr.handler.dataimport.DocBuilder – Exception while processing: Entity document : SolrInputDocument(fields: []):org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: select * from entity Processing Document # 1
at
org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:283)
at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:240)
at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:44)
at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:59)
at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:73)
at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:476)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:415)
at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:330)
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:232)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:416)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:480)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:461)
Caused by: java.lang.NullPointerException
at org.apache.cassandra.cql.jdbc.ListMaker.compose(ListMaker.java:61)
at org.apache.cassandra.cql.jdbc.TypedColumn.<init>(TypedColumn.java:68)
at org.apache.cassandra.cql.jdbc.CassandraResultSet.createColumn(CassandraResultSet.java:1174)
at org.apache.cassandra.cql.jdbc.CassandraResultSet.populateColumns(CassandraResultSet.java:240)
at org.apache.cassandra.cql.jdbc.CassandraResultSet.<init>(CassandraResultSet.java:200)
at org.apache.cassandra.cql.jdbc.CassandraStatement.doExecute(CassandraStatement.java:169)
at org.apache.cassandra.cql.jdbc.CassandraStatement.execute(CassandraStatement.java:205)
at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:276)
... 12 more
CREATE TABLE dev.entity (
id uuid PRIMARY KEY,
begining int,
domain text,
domain_type text,
template_name text,
****field_values list<frozen<fieldmap>>****
)
User Defined Type :
CREATE TYPE galaxy_dev.fieldmap (
key text,
value text );
Please let me know what driver or Jar use to create SOLR index for latest CASSANDRA.

Resources