Code Monkey home page Code Monkey logo

Comments (3)

radar avatar radar commented on August 10, 2024

Hey Dragos,

Do you have a script that reproduces this problem that I could try to run?

On 23 Nov. 2016, at 12:36, Dragos [email protected] wrote:

When I do indexing like this:

ProductDocument.index(product.id, data)

every now and then, I get this error:

** (FunctionClauseError) no function clause matching in Elastic.ResponseHandler.process/1
(elastic) lib/elastic/response_handler.ex:4: Elastic.ResponseHandler.process(%HTTPotion.ErrorResponse{message: "req_timedout"})
(elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:651: Enum.each/2
(elixir) lib/code.ex:363: Code.require_file/2
(mix) lib/mix/tasks/run.ex:71: Mix.Tasks.Run.run/1
(mix) lib/mix/task.ex:296: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
(elixir) lib/code.ex:363: Code.require_file/2
The indexing works( ie the document is indexed and can be search) but the script that does multiple indexing operations breaks after the first operation.

It seems that assigning the result to a variable
response = ProductDocument.index(product.id, data)
doesn't break the script after the first indexing operation but I'm not sure if this was the intended behaviour of the package.

What would be a better solution( if any)?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from elastic.

miskolc avatar miskolc commented on August 10, 2024

I don't have a script because I ran that line of code in the console, but I've noticed the error happens when I run that instruction shortly after I open iex.

Also since I've initially opened this issue, I've noticed that this error also appears when I do a bulk create with too many rows( ie Elastic.Bulk.create(indexable_chunk)). If index_chunk has more that 10_000 tuples in it, I get that error, otherwise, if it's 10_000 or less I get no error and I also don't need to assign the result to any variable.

So now I think the error has more to do with the fact that ES can't handle new requests at a certain point in time, rather that what I said in my previous comment.

from elastic.

radar avatar radar commented on August 10, 2024

Ok, no worries. I don't know of a good way to make Elastic.Bulk.create complain if you pass it a large amount of chunks... or even if it should complain!

I think the req_timedout message should be handled better, and so I've made 39c9bc7 for that.

from elastic.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.