Comments (8)
Doesn't look like you are doing anything wrong. There is an error in the JSON, in the _source field... Can you try running the requests with curl to see if you get the same response body?
curl 'http://localhost:9200/places/snackbar/_search?pretty=true' -XPOST -d '{
"query": {
"match": {
"heading": "het"
}
}
}'
from elasticsearch-js.
Good, I thought so. This is the curl output:
{
"took" : 14,
"timed_out" : false,
"_shards" : {
"total" : 3,
"successful" : 3,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.19178301,
"hits" : [ {
"_index" : "places",
"_type" : "snackbar",
"_id" : "1",
"_score" : 0.19178301, "_source" : {heading:"Het Geveltje", text: "Foo"}
} ]
}
}
I don't see a JSON error in the source field? Or do you mean that the error msg implies that there should be one?
from elasticsearch-js.
The heading and text keys need to be wrapped in quotes for it to be valid json
from elasticsearch-js.
What version of Elasticsearch are you running?
from elasticsearch-js.
Looks like you are indexing invalid JSON. Elasticsearch will still parse it sometimes, and when it succeeds it will return the original source to you. elastic/elasticsearch#586
Can you verify that this is the case?
from elasticsearch-js.
Running latest, 0.90.9. But indeed, that was the case, indexed invalid JSON! This was confusing though, missed those quotes. Thanks a lot!
from elasticsearch-js.
I ran into this today. We are using a river to load data. I deleted the indexes and the rivers, then re-added them and things were better.
Hopefully that helps others. This thread was very helpful for me.
from elasticsearch-js.
This helps me too.
from elasticsearch-js.
Related Issues (20)
- Connection pool size HOT 1
- Support Cloudflare Workers / Vercel Edge Functions HOT 3
- The query attribute on the `EnrichPolicy` should be `QueryDslQueryContainer | QueryDslQueryContainer[]` not `string` HOT 3
- Bulk helper not giving indications on failure when using stream as datasource HOT 1
- Number of open connections spikes when retryable errors occur HOT 4
- Deno: Module '"npm:@elastic/elasticsearch"' has no exported member 'CatIndicesIndicesRecord'. HOT 1
- Internal module error HOT 1
- bulk helper add onSuccess callback HOT 3
- Content-Type header being changed to "text/plain" from "application/json" somewhere in the process of publishing a document to self-hosted Elasticsearch HOT 5
- Global client context not passed to Transport in 7.13.0 HOT 1
- Support for ES|QL HOT 2
- enum and/or type guard for QueryDslTextQueryType HOT 1
- search_after with sort on nested fields HOT 1
- Redaction mechanism transform arrays properties into objects HOT 1
- Nuxt 3 compatibility HOT 1
- Using the `[]` chars for an enrich policy name isn't wrapped correctly on `deletePolicy` method HOT 1
- ProductNotSupportedError: The client noticed that the server is not a supported distribution of Elasticsearch HOT 1
- Add types for plugins HOT 2
- Error parsing undici module in Next.js 14 project HOT 3
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 product-check listeners added HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch-js.