Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to mitigate specific errors caused by some field ? #491

Closed
ghost opened this issue Jan 3, 2023 · 0 comments
Closed

Any way to mitigate specific errors caused by some field ? #491

ghost opened this issue Jan 3, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 3, 2023

Hi,
We have a basic schema but now extended to include some arbitrary keys, apparently Solr doesn't like schema-less and infer schema based on first inserted documents (as far as I understood).

So having such error when inserting documents (one only is erroneous):

Error: Request HTTP error 400: {
"responseHeader":{
"status":400,
"QTime":1},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"ERROR: [doc=c24b6880-0000-11ec-b3d7-315ff10bc15c/expByDate#] Error adding field 'power_point'='17' msg=incompatible dimension (2) and values (17). Only 0 values specified",
"code":400}}

I wish not to ignore the erroneous document, but go back and modify it (removing the only field causing problems).

I can spot the field dynamically scanning the error message but is there a better way ? maybe a custom error because it is nearly impossible to parse the error reliably:
All I could do is to retrieve error.message which is a string, that I could not parse as a JSON anyhow.

or maybe in solrClient.add(data); itself, (like except a specific failing facet or field if I understand well).

of course insertion is simply:

await solrClient.add(data);
this.solrCommit();

Thanks again :)

@ghost ghost closed this as completed Jan 4, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants