werbitzky / elastix Goto Github PK
View Code? Open in Web Editor NEWA simple Elasticsearch REST client written in Elixir.
License: Do What The F*ck You Want To Public License
A simple Elasticsearch REST client written in Elixir.
License: Do What The F*ck You Want To Public License
We're using elastic search on AWS which requires HMAC key signing as described here http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html
This elixir library implements it (https://github.com/bryanjos/aws_auth) nicely, but not sure best way to extend HTTP module to allow for auth other than shield. Happy to contribute if I can (and may have to fork library just to add it, if I can't find a clean way to work around), but I'm just getting my feet wet, and not sure if you have a strong preference for how it be done. Thanks!
The README describes supporting custom headers, however the same commit that adds that documentation seems to have actually removed support for custom headers. (03daf52)
I would like to be able to use this library with elasticsearch on AWS and I am happy to contribute towards a solution.
Some ideas:
.call()
). Maybe just a {Module, :fun, []} tuple that gets arguments prepended an applied.config :elastix, auth: Elastix.HTTP.Authentication.Shield
.In the latter case AWS support could be added to this repo, added as a second hex package, or even just provide an example implementation in docs.
I'd like to use Elastic's Update API to make partial or scripted update to an existing document. Any plans on adding this? thanks in advance!
Currently the version of elastix
on Hex is 0.4.0
. That version seems to be missing some of the recent updates (most notably support for custom headers). Is it possible to update the hex repo to the new version that includes recent changes?
Also, I noticed all documentation seems to be missing from the Hex docs page. Is adding documentation open and feasible for new contributors?
Calling Document.index_new/4
or Document.index_new/5
produces the wrong url because it appends a double backslash (e.g. "/movies/movie//"
). This can cause problems with AWS authentication since it affects the request signature.
Seems like a minor fix so I would be glad to make a PR if needed.
Hey
Is there a API to update the index settings or to setup it together the mapping using Elastix?
Would it be possible to add support for bulk indexing documents, as described in the Elasticsearch Bulk API docs? Thanks in advance!
I would like to be able to search multiple indices. I suggest the search
function is extended so that the index
parameter can be an array.
Description
Currently, we're using HTTPoison by default. This might introduce issues like we won't be able to trace this request.
If possible, can we write behavior for HTTP lib and accept that from config?
or is it possible to trace in the current situation and I am not aware of?
The @spec
is wrong for Index.exists?
.
It's specificed as.
@spec exists?(elastic_url :: String.t(), name :: String.t()) :: HTTP.resp()
But it does not return a HTTP.resp()
, it returns {:ok, boolean()} | {:error, HTTPoison.Error.t()}
(the :ok
case is just a boolean, not the full Elasticsearch response)
I see count function added into Elastix.search module but release 0.5.0 didnt have that.
When are you planning to release next version?
Hey guys, my pull request to update the poison version has been approved and merged, however the dependency version was not updated in package manager.
Can anyone update please?
How is the code now to assign as mapping settings? I'm trying a few ways with a new application, but I only have this return error:
Types cannot be provided in placement mapping requests unless the include_type_name parameter is set to true. "
In the latest version (HTTPoison 1.4.0), they have introduced a Request struct
edgurgel/httpoison#311
that makes the call here https://github.com/werbitzky/elastix/blob/master/lib/elastix/http.ex#L35 broken
Given an elasticsearch target, namespaced into a sub-path by nginx,
when I pass the full host+path into Elastix.Search.search (and other functions also)
then the path component of the elasticsearch url is stripped away.
I believe this code is problematic, in search.ex
def make_path(index, types, query_params, api_type \\ "_search") do
path_root = "/#{index}"
When the index+type+queryparam path is passed to URI.merge, in prepare_url
,
the preceding forwardslash in the index path replaces any existing path in the host url,
since URI.merge follows Relative Resolution of RFC 3986
Hi,
On a very long search request, I quickly get : %HTTPoison.Error{id: nil, reason: :timeout}
How to setup the timeout ?
Regards and thank you for your work !
Thanks for this library! I'm evaluating elastix and elasticsearch-elixir for a production app and was wondering if you have any thoughts, however brief, on how these libraries might compare? Might even be worth adding to README at some point.
It would be nice to be able to pattern match on errors/ok, but it is not possible due to the error/ok atom being thrown away.
Example:
https://github.com/werbitzky/elastix/blob/master/lib/elastix/document.ex#L76
Wouldn't it be nicer to use the {:ok, res}
and {:error, reason}
. Or is there any other reason why this is being stripped away?
delete
from Document
was not working for me without implementing a variant that includes auth options.
I would get
{:error,
%HTTPoison.Error{
reason: {:tls_alert,
{:unknown_ca,
~c"TLS client: In state wait_cert at ssl_handshake.erl:2138 generated CLIENT ALERT: Fatal - Unknown CA\n"}},
id: nil
}}
After trying my variant it worked. Am I missing something or is this missing? I could open a PR for that change if somebody gives me green light. ๐ข
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.