Url Encoding problem in Java and Solr - java

I am working in Solr and making some filter quires. One of my filter is consists of a space
for eg:- "fq=listing_type:New home"
But this is giving error. No result is comming out.
I also tried "fq=Listing_type:New+home"
This was not giving error. But no results are comming out. Event there is some xml which have thse values.
Can anyone tell me where is my error?
Here you see the schema.xml

Have you tried with fq=listing_type:"New home" ??? Why dont you index this field as "NewHome" ?

Related

How to debug a JSON error (occuring in Wordpress Backend)?

I am experiencing a problem with Wordpress.
Everything seems to work fine, but with the usage of some (3rd-party)-Blocks in the Gutenberg-editor, something is causing an issue, I assume with Java.
If the content in Wordpress is saved, an error occurs:
Updating failed. The response is not a valid JSON response.
There is not more to the error. Debug enabeling in wp-config does not log any errors. If I am right, this is correct, because this debug-function in WP would only log php related issues.
On the Internet there are all kinds of random solutions to fix this error (change permalinks as an example). Does not do anything for me. More random solutions are deactivating all plugins. Still, the issue persists. Update Wordpress and php. Done. Error persists.
All the above seems to be "searching in the dark". So I would like to know, how to find out, what the acutal issue is. Surely, there must be some kind of debugging?
I found something somewhere on the net in regards to get the last JSON-error from the server:
if (!function_exists('json_last_error_msg')) {
function json_last_error_msg() {
static $ERRORS = array(
JSON_ERROR_NONE => 'No error',
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',
JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
JSON_ERROR_SYNTAX => 'Syntax error',
JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded'
);
$error = json_last_error();
return isset($ERRORS[$error]) ? $ERRORS[$error] : 'Unknown error';
}
}
?>
If I understood this right, the above code should go in a .php-file, which I call trough the browser. Did it, tried it. Browser window remains just blank. So either this is not working for me, or there is just no error stored?
Who can point me in the right direction?
I also did create two test pages in WP, and tried to save both. One without the error causing element, and one with. Both attempts have been logged, using the Borwser's Developer-Tools on the "network" tab. If anybody thinks, this would be of help to evaluate the issue, let me know and I will upload them.

Beginner to API Json - Attempting to understand URL output

I am using FME to get output from the following: https://coronavirus.data.gov.uk/developers-guide
I am just a beginner and is first time I want to write this up. To generate an Output URL from this with the relevant columns, can anyone explain what I need to get the request URL. I am using GET as the HTTP method
An example of a url i get some data out of is - https://soa.smext.faa.gov/asws/api/airport/status/SFO
But when i try with the links below which i tested does not get any output https://api.coronavirus.data.gov.uk/v1/data?filters=areaType=nation;areaName=england&structure=%7B%22name%22:%22areaName%22%7D
https://api.coronavirus.data.gov.uk//v1/data?filters=areaType=nation;areaName=england&structure={"date":"date","areaName":"areaName","areaCode":"areaCode","newCasesByPublishDate":"2020-07-07","cumCasesByPublishDate":"2020-08-08","newDeathsByDeathDate":"2020-02-06","cumDeathsByDeathDate":"2020-06-09"}
This is a better link for you to try out.
https://api.coronavirus.data.gov.uk/v1/data?filters=areaType=nation;areaName=england&structure={%22date%22:%22date%22,%22areaName%22:%22areaName%22,%22areaCode%22:%22areaCode%22,%22newCasesByPublishDate%22:%22newCasesByPublishDate%22,%22cumCasesByPublishDate%22:%22cumCasesByPublishDate%22,%22newDeaths28DaysByDeathDate%22:%22newDeaths28DaysByDeathDate%22}
Took me a while to suss it out.

Getting StringIndexOutOfBounds exception with Progress Database

I am getting the below exception when I am trying to retrieve data from Progress database.
Exception::java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at com.progress.sql.jdbc.JdbcProgressResultSet.reWordAsCountQuery(JdbcProgressResultSet.java:6634)
at com.progress.sql.jdbc.JdbcProgressResultSet.calculateRowCount(JdbcProgressResultSet.java:6427)
at com.progress.sql.jdbc.JdbcProgressResultSet.initialize(JdbcProgressResultSet.java:157)
at com.progress.sql.jdbc.JdbcProgressStatement.getResultSet(JdbcProgressStatement.java:435)
at com.progress.sql.jdbc.JdbcProgressPreparedStatement.executeQuery(JdbcProgressPreparedStatement.java:97)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at com.esb.service.DBService.handleStatement(DBService.java:992)
One thing I noticed is if I put a space at the beginning or end of the query the query works fine.But this looks strange to me.
Can any one help me resolve this issue.
Thanks in Advance.
Given this bug report page, it looks like you basically need to update to a later release.

Java error: Context already contains a binding with name ""

Ok so I have followed this tutorial step by step: Custom Java Desktop Database Application
I can't understand what I'm doing wrong but when I run the application and click on "New Customer" i get the following error:
Caused by: java.lang.IllegalArgumentException: Context already contains a binding with name ""
I believe that it has something to do with the combobox which is binded with the countries list which comes from the database. The binding expression is set to null and binding source is set to countriesList.
Any help would be appreciated guys?
Thanks
SOLVED
When binding elements of the combo box, in the advanced tab, I just set the name to "null"..and it started working.
while giving "null" into Identification's name works, it only works for the second occurance, you may not repeat the "null" string as the name for the third or any other occurances.
Because,
actually the only one we need to remember is, the name needs to be unique. That's all :)
It seems something was changed in Netbeans. The bindings don't need a name, but for some reason Netbeans started adding "" as the name of many bindings. My solution has been to open the .java file in another editor and just removing the last , "" in the createAutoBinding method call.

jqGrid problem, expecting jQuery.jgrid but $.jgrid exists instead

I'm using jqGrid for a JIRA plugin and have included the jquery and jqgrid libraries as web resources.
I've set up a column in jqGrid as required and when I try to submit the form with the respective column empty I get an error in firebug: jQuery.jgrid is undefined
jQuery.jgrid is null but $.jgrid has the correct data.
Does anyone know how I can set up jqgrid so that it points to the $.jgrid without having to change all the source code? or any other way round this?
Thanks
That is really weird. Maybe this will work:
jQuery.fn.jgrid = $.jqgrid;
You should try that, but I'm really not shure if it will work.

Categories

Resources