Questions tagged [elasticsearch-ruby]

31 questions
1
vote
1 answer

Connect Rails app to Elasticsearch server

I am using logstash+elasticsearch to index server logs. The Elasticsearch server is running at localhost:9200 with millions of server log docs. I also have a Rails app running at localhost:3000. I need to connect this rails app to the ES server. I…
0
votes
0 answers

Elasticsearch ruby clear_scroll API

I'm trying to use ES v6 scroll API to fetch the data in batches from the index The issue that I facing is in clear_scroll function as it takes scroll_id as an argument and put it in the URL as a query param which leads to cause a failure due to the…
0
votes
0 answers

Elasticsearch saves document as string of array, not array of strings

I am trying to contain array as a document value. I succeed it in "tags" field as below; This document contains array of strings. curl -XGET localhost:9200/MY_INDEX/_doc/132328908 #=> { "_index":"MY_INDEX", "_type":"_doc", "_id":"132328908", …
0
votes
1 answer

elasticsearch-ruby: transforms

We can read into the elasticsearch-ruby CHANGELOG (Vewsion 7.7.0) That we have New API Endpoints availables. Transforms included. Here they are. We are using elasticsearch-ruby 7.15.0. But don't know how to use it. Here is my example... require…
icalvete
  • 987
  • 2
  • 16
  • 50
0
votes
1 answer

Filtering Elastic search result with must and match giving unexpected result

{ "body": { "query": { "bool": { "must": { "match": { "_id": "24" } }, "should": [ { "term": { "draft_id": "draft_11" } }, …
przbadu
  • 5,769
  • 5
  • 42
  • 67
0
votes
1 answer

How to consume a document in attachment pipeline using elasticsearch ruby?

I am trying to attach a document in elasticsearch pipeline but I didn't any method for it. For this call - PUT my_index/my_type/my_id?pipeline=attachment { "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=" } Please let…
sushilprj
  • 2,203
  • 1
  • 14
  • 19
0
votes
2 answers

How to create ingest pipeline in elasticsearch using elasticsearch-ruby gem

I am struggling, How to create ingest attachment pipeline using elasticsearch-ruby gem? For this call - PUT _ingest/pipeline/attachment { "description" : "Extract attachment information", "processors" : [ { "attachment" : { …
sushilprj
  • 2,203
  • 1
  • 14
  • 19
0
votes
0 answers

Schema-less indexing search

I have a set of data following a similar data structure below: { "first_name": "some_value", "last_name": "some_value_2", "instance": "some_instance" "num_of_tries": 159, "uuid": "some_uuid", "background": "something the user…
Sean
  • 2,496
  • 7
  • 32
  • 60
0
votes
1 answer

update elasticcache record without totally replacing it

I'm using this to add a bunch of records to the elasticcache index: def self.index_trends(trend_hashes) formatted_trends = trend_hashes.map do |trend_hash| { index: { _index: 'trends', _type: 'trend', …
max pleaner
  • 26,189
  • 9
  • 66
  • 118
0
votes
1 answer

Can't test with rspec and elasticsearch-extensions on Ubuntu

I've followed this guide to run integration tests in rspec with the elasticsearch-extensions gem, but at the moment I run Elasticsearch::Extensions::Test::Cluster.start(port: 9250, nodes: 1, timeout: 120), the following error is thrown: Starting 2…
Alter Lagos
  • 12,090
  • 1
  • 70
  • 92
0
votes
1 answer

where to specify cluster details when using elastic search gem in Ruby

I want to access the data in Elastic Search Cluster from my rails application. Lets say server is running at http://localhost:9200 and I want to access the end point http://localhost:9200/location/type. The following this documentation and came…
python
  • 4,403
  • 13
  • 56
  • 103
0
votes
1 answer

Faraday::SSLError for Elasticsearch

Currently running into an issue where my background workers which are communicating with elasticsearch via elasticsearch-client are running into SSL errors inside Faraday. The error is this: SSL_connect returned=1 errno=0 state=SSLv3 read server…
pech0rin
  • 4,588
  • 3
  • 18
  • 22
0
votes
1 answer

How to add OR condition in Elasticsearch ruby query?

In my use case, I would like to add an OR condition in Elasticsearch query. Here is my query, query_body = { 'query' => { 'bool' => { 'must' => [{ 'range' => {'@timestamp' => { 'from' =>…
Dany
  • 2,692
  • 7
  • 44
  • 67
0
votes
1 answer

Analyzing the same search field twice returns 0 results on subfield in ElasticSearch

I have a field called search_text which is a full text search field. I am using ngrams to index this field, I wanted to add a new sub-field search_text.words that will index this on whole words. I tried to implement this, but querying the…
Steve
  • 2,764
  • 4
  • 27
  • 32
0
votes
2 answers

validates_uniqueness_of elasticsearch persistence

How to validates_uniqueness_of for elasticsearch persistence. I have in a model with the include statement include Elasticsearch::Persistence::Model I want to include a uniqueness validation like validates_uniqueness_of :username When I tried to…