Strange Error Message while Full Import
Hallo, when I do a full import of a SOLR index I become a strange error message: org.apache.solr.handler.dataimport.DataImportHandlerException: java.sql.SQLRecoverableException: Closed Resultset: next It is only a simple query select FIRMEN_ID, FIRMIERUNG, FIRMENKENNUNG, PZN, DEBITORNUMMER, ADRESS_ID from DAT_FIRMA This error seems to be a subsequent error but there is no other cause in the stacktrace. Thanks for any hints. Ciao Peter Schütt P.S. The error stacktrace Feb 03, 2014 2:11:01 PM org.apache.solr.common.SolrException log SEVERE: getNext() failed for query 'select FIRMEN_ID, FIRMIERUNG, FIRMENKENNUNG, PZN, DEBITORNUMMER, ADRESS_ID from DAT_FIRMA':org.apache.solr.handler.dataimport.DataImportHandlerException : java.sql.SQLRecoverableException: Closed Resultset: next at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd Throw(DataImportHandlerException.java:63) at org.apache.solr.handler.dataimport.PreparedStatementJdbcDataSource$Re sultSetIterator.hasnext(PreparedStatementJdbcDataSource.java:404) at org.apache.solr.handler.dataimport.PreparedStatementJdbcDataSource$Re sultSetIterator.access$600(PreparedStatementJdbcDataSource.java:256) at org.apache.solr.handler.dataimport.PreparedStatementJdbcDataSource$Re sultSetIterator$1.hasNext(PreparedStatementJdbcDataSource.java:324) at org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(Entity ProcessorBase.java:116) at org.apache.solr.handler.dataimport.PreparedStatementSqlEntityProcesso r.handleQuery(PreparedStatementSqlEntityProcessor.java:119) at org.apache.solr.handler.dataimport.PreparedStatementSqlEntityProcesso r.nextRow(PreparedStatementSqlEntityProcessor.java:124) at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent ityProcessorWrapper.java:243) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument (DocBuilde r.java:465) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument (DocBuilde r.java:404) at org.apache.solr.handler.dataimport.DocBuilder.doFullDump (DocBuilder.j ava:319) at org.apache.solr.handler.dataimport.DocBuilder.execute (DocBuilder.java :227) at org.apache.solr.handler.dataimport.DataImporter.doFullImport (DataImpo rter.java:422) at org.apache.solr.handler.dataimport.DataImporter.runCmd (DataImporter.j ava:487) at org.apache.solr.handler.dataimport.DataImporter$1.run (DataImporter.ja va:468) Caused by: java.sql.SQLRecoverableException: Closed Resultset: next at oracle.jdbc.driver.OracleResultSetImpl.next (OracleResultSetImpl.java: 214) at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.next (DelegatingResult Set.java:207) at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.next (DelegatingResult Set.java:207) at org.apache.solr.handler.dataimport.PreparedStatementJdbcDataSource$Re sultSetIterator.hasnext(PreparedStatementJdbcDataSource.java:396) ... 13 more
explicite deltaimports by given ids
Hallo, I want to trigger a deltaimportquery by given IDs. Example: query=select oid, att1, att2 from my_table deltaImportQuery=select oid, att1, att2 from my_table WHERE oid=${dih.delta.OID} deltaQuery=select OID from my_table WHERE TIME_STAMP TO_DATE (${dih.last_index_time:VARCHAR}, '-MM-DD HH24:MI:SS') deletedPkQuery=select OID from my_table where TIME_STAMP TO_DATE(${dih.last_index_time:VARCHAR}, '-MM- DD HH24:MI:SS') Pseudo URL: http://solr-server/solr/mycore/dataimport/?command=deltaImportQueryoid=5 oid=6 to trigger the update or insert of the datasets with OID in (5, 6). What is the correct way? Thanks for any hint. Ciao Peter Schütt
Re: Oracle Timestamp in SOLR
Hallo, : SELECT ... CAST(LAST_ACTION_TIMESTAMP AS DATE) AS LAT : : This removes the time part of the timestamp in SOLR. althought it is : shown in PL/SQL-Developer (Tool for Oracle). Hmmm... that makes no sense to me based on 10 seconds of googling... http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#i184 7 The DATE datatype stores the year (including the century), the month, the day, the hours, the minutes, and the seconds ...but i'll take your word for it. : The only way I found in the net is to write an own converter :-( There must be *some* way to either tweak your SQL or tweak your JDBC connection properties such that Oracle's JDBC driver will give you a legitimate java.sql.Date or java.sql.Timestamp instead of it's own internal class (that doesn't extend java.util.Date) ... otherwise it's just total freaking anarchy. Perhaps it is really an oracle problem. I found also this solution: http://stackoverflow.com/questions/10111517/getting-correct-time-from- oracle-date-in-solr-dataimporthandler but I did not get it to run. So I keep my timestamp - string - date way (which I do not really like). Ciao Peter Schütt
Re: Explicite update or delete of a dataset
Hallo, To delete: curl http://localhost:8983/solr/update?commit=true \ -H 'Content-type:application/json' \ -d '{delete: {id:doc-0001}}' I try it in this way: http://localhost:9180/solr/mycore/update?commit=truestream.body=delete queryoid:A6DBFADE63A75054E043AC1C02205054/query/delete and it works. Thanks for help. Ciao Peter Schütt
Re: Oracle Timestamp in SOLR
Hallo, : I have a field with the type TIMESTAMP(6) in an oracle view. ... : What is the best way to import it? ... : This way works but I do not know if this is the best practise: ... : TO_CHAR(LAST_ACTION_TIMESTAMP, '-MM-DD HH24:MI:SS') as : LAT instead of having your DB convert to a string, and then forcing DIH to parse that string, try asking your DB to cast to something that JDBC will respect as a Date object when DIH fetches the results I don't know much about oracle, but perhaps something like... SELECT ... CAST(LAST_ACTION_TIMESTAMP AS DATE) AS LAT This removes the time part of the timestamp in SOLR. althought it is shown in PL/SQL-Developer (Tool for Oracle). The only way I found in the net is to write an own converter :-( Thanks in advance for any other hints. Ciao Peter Schütt
Explicite update or delete of a dataset
Hallo, how can I update or delete a single dataset by a given ID? Thanks for any hint. Ciao Peter Schütt
Oracle Timestamp in SOLR
Hallo, I have a field with the type TIMESTAMP(6) in an oracle view. When I want to import it directly to SOLR I get this error message: WARNING: Error creating document : SolrInputDocument[oid=12, last_action_timestamp=oracle.sql.TIMESTAMP@34907781, status=2, ...] org.apache.solr.common.SolrException: Invalid Date String:'oracle.sql.TIMESTAMP@ 34907781' at org.apache.solr.schema.DateField.parseMath(DateField.java:182) at org.apache.solr.schema.TrieField.createField(TrieField.java:616) at org.apache.solr.schema.TrieField.createFields (TrieField.java:655) What is the best way to import it? This way works but I do not know if this is the best practise: In the query: TO_CHAR(LAST_ACTION_TIMESTAMP, '-MM-DD HH24:MI:SS') as LAT For the field: field column=LAT name=last_action_timestamp dateTimeFormat=-MM-dd hh:mm:ss / Conversion from timestamp to string to timestamp seems to me not a good way. Is there a better way? Thanks for any hints. Ciao Peter Schütt
A Comma /aSpace in a Query argument
Hallo, I want to use a comma as part of a query argument. E.G. q=myfield:aa,bb and aa,bb is the value of the field. Do I have to mask it? And what is about a space in an argument q=myfield:aa bb and aa bb is the value of the field. Thanks for any hint. Ciao Peter Schütt
Re: More than one sort criteria
Hallo, Peter, try sorting them only using one sort parameter, separating the fields by comma. sort=zip+asc,street+asc This was it, thank you. Ciao Peter Schütt
More than one sort criteria
Hallo, I have more than one sortable fields. Example: I have address data and I want to sort by zip code and street name. Now I have both fields as sortable declared in the schema and I can sort by them. q=*sort=zip+asc or q=*sort=street+asc But how can I sort by both (first zip code then street). q=*sort=zip+ascsort=street+asc I got no error message, but the result is not sorted by the second criteria. The params are: lst name=params arr name=sort strzip asc/str strstreet desc/str /arr str name=indenttrue/str str name=q*/str str name=wtxml/str /lst What is my mistake? Thanks for any hint. Ciao Peter Schütt
Query Parser OR AND and NOT
Hallo, I do not really understand the query language of the SOLR-Queryparser. I use SOLR 4.2 und I have nearly 20 sample address records in the SOLR-Database. I only use the q field in the SOLR Admin Web GUI and every other controls on this website is on default. First category: zip:30* numFound=2896 city:H* OR zip:30* numFound=12519 city:H* AND zip:30* numFound=376 These results seems to me correct. Now I tried with negations: !city:H*numFound:194577(seems to be correct) !city:H* AND zip:30*numFound:2520(seems to be correct) !city:H* OR zip:30* numFound:2520(!! this is wrong !!) Or do I do not understand something? (!city:H*) OR zip:30*numFound: 2896 This is also wrong. Thanks for any hint to understand the negation handling of the query language. Ciao Peter Schütt
Re: Query Parser OR AND and NOT
Hallo, Roman Chyla roman.ch...@gmail.com wrote in news:caen8dywjrl+e3b0hpc9ntlmjtrkasrqlvkzhkqxopmlhhfn...@mail.gmail.com: should be: -city:H* OR zip:30* -city:H* OR zip:30* numFound:2520 gives the same wrong result. Another Idea? Ciao Peter Schütt
WADL for REST service?
Hallo, does a WADL exists for the REST service of SOLR? Ciao Peter Schütt