Questions tagged [elasticjs]

elasticjs is a JavaScript implementation of the ElasticSearch Query DSL and Core API.

elasticjs is a JavaScript implementation of the ElasticSearch Query DSL and Core API.

Source on GitHub

18 questions
6
votes
0 answers

How to fix '400 Bad request' in half of my request to Elastic search?

I'm using elastic search cloud with a single index that has a single document. I'm using @elastic/elasticsearch latest version. I'm calling elastic search from Firebase cloud functions. Here is how my elastic client is initialized in cloud…
3
votes
2 answers

How to index documents with elastic.js client?

So far I haven't found any samples of HOW the elastic.js client api (https://github.com/fullscale/elastic.js) can be used for indexing documents. There are some clues here & there but nothing concrete…
pulkitsinghal
  • 3,855
  • 13
  • 45
  • 84
2
votes
1 answer

Abort elasticsearch request using elastic.js

Is there a way to cancel requests/queries to Elasticsearch using elasticjs? The web app I am working on performs a request/query every 5 seconds, but I would like to cancel the request if for some reason the response doesn't show up in 5 seconds…
chevin99
  • 4,946
  • 7
  • 24
  • 32
1
vote
1 answer

Elastic JS node JS unable to update index

I Have this strange error while I'm trying to update an index on elasticJS using express: router.put('/update/:id', async (req, res) => { try { console.log('Entered updateuser', req.params.id); const salt = await bcrypt.genSalt(10); …
Alexander
  • 1,288
  • 5
  • 19
  • 38
1
vote
2 answers

Elasticsearch aggregation query in elastic.js

I have a hard time translating aggregation query for elastic search into elastic.js. I am reading the documentation but I just can not figure it out. And the examples that you can find online are mostly about deprecated facets feature, that is not…
Tomasz Swider
  • 2,314
  • 18
  • 22
1
vote
1 answer

Query the number of elements matching a filter using elastic.js?

I'm building a leaderboard with elasticsearch. I'd like to query all documents who have points greater than a given amount using the following query: { "constant_score" : { "filter" : { "range" : { "totalPoints" : { …
Dany Joumaa
  • 2,030
  • 6
  • 30
  • 45
0
votes
1 answer

Elasticsearch js client.close()

I'm using elasticsearch client library on NodeJS, and I'm trying to understand if and when to use the client.close()method. I'm using the same client in my entire application, and once in a while I'm doing some search on ES. I was wondering first…
ChikChak
  • 936
  • 19
  • 44
0
votes
1 answer

How to create a search using multiple variables and to make them not mandatory

I have this code : let jobs = await client.search({ index: 'something', type: 'doc', body: { query: { bool: { must: [ { match: { title: `test` …
Alexander
  • 1,288
  • 5
  • 19
  • 38
0
votes
1 answer

How to "throw" custom error messages in elastic's updateByQuery

I update my docs with the javascript api's updateByQuery using const res = await this.elastic.update({ index: MY_INDEX, type: MY_TYPE, id: MY_ID, _source: true, body: { script: { source: ` // stuff `, }, …
Simon
  • 1,681
  • 1
  • 21
  • 34
0
votes
1 answer

firebase flashlight partial match for only one field

for my app i use the flashlight searchengine, in my elastic table i store a data with two fields id: { name: "", uid: "" }. when i want to retrive certain value i want to do a partial match only in the name field and retrive all two fields if the…
DThink
  • 429
  • 2
  • 18
0
votes
2 answers

How to delay consuming message in Kafka nodejs?

I am using NodeJS to consume message from Kafka, after received the message , I will bring it to create an index in Elasticsearch. This is my piece of code : kafkaConsumer.on('message', function (message) { elasticClient.index({ index:…
xtiger
  • 1,446
  • 2
  • 15
  • 33
0
votes
1 answer

Server-side elasticsearch filters

I am using the javascript-elasticsearch API for searching data. However, I need to limit access to a certain group based upon their studio. For example: obj1 title = Titanic studio = Fox obj2 title = Lion King studio = Disney I can do the query:…
David542
  • 104,438
  • 178
  • 489
  • 842
0
votes
1 answer

elastic.js + node.js : queries not making sense

As seen on the official documentation of FullScale, I've got : // The official one var elasticsearch = require('elasticsearch'); var client = new elasticsearch.Client({ host: conf.elastic.server }); // FullScale one (for some reasons, needing…
Romain
  • 3,586
  • 7
  • 31
  • 52
0
votes
1 answer

Access to request result of elastic.js from js code

I have this code: $scope.search = function() { $scope.results = ejs.Request() .query(ejs.TermQuery("amount", 10)).size(10).from(0) .doSearch(); console.log($scope.results.v); }; and…
Aryan
  • 2,675
  • 5
  • 24
  • 33
0
votes
0 answers

Elasticsearch and Elastic.js Query

i am currently using Elastic.js (Angular.js integration) to query Elasticsearch. I have an Elasticsearch query that is as follows: { "query" : { "range" : { "created_at" : { "from" : "2013-07-21T03:55:32.000" …
1
2