Closed jorol closed 7 years ago
It works when I add an _id
and use the --key_prefix my_
option:
$ echo '{ "title":"My first blog entry","text": "Just trying this out...","date": "2014/01/01","my_id":"333"}' | catmandu -I ./lib import -v JSON to ElasticSearch --index_name website --bag blog --key_prefix my_
imported 1 object
done
$ catmandu count ElasticSearch --index_name website --bag blog
1
$ catmandu export ElasticSearch --index_name website --bag blog --id 333
[{"text":"Just trying this out...","my_id":"333","date":"2014/01/01","title":"My first blog entry"}]
But I still get an error when I export the whole index:
$ catmandu export ElasticSearch --index_name website --bag blog
Oops! [Request] ** [http://localhost:9200]-[400] [illegal_argument_exception] No search type for [scan], called from sub Search::Elasticsearch::Client::5_0::Direct::scroll_helper at /home/jorol/Devel/Dist/Catmandu-Store-Elasticsearch/lib/Catmandu/Store/ElasticSearch/Bag.pm line 43. With vars: {'status_code' => 400,'request' => {'qs' => {'size' => 100,'scroll' => '1m','search_type' => 'scan'},'body' => {'query' => {'match_all' => {}}},'path' => '/website/blog/_search','mime_type' => 'application/json','serialize' => 'std','ignore' => [],'method' => 'GET'},'body' => {'status' => 400,'error' => {'reason' => 'No search type for [scan]','type' => 'illegal_argument_exception','root_cause' => [{'reason' => 'No search type for [scan]','type' => 'illegal_argument_exception'}]}}}
Key prefix is alsways needed with ES >= 2.0. I'll look into your last error.
This is fixed in version 0.0507. Info about configuring the correct client for older versions of es has also been added to the pod
Hi,
I've upgraded Elasticsearch to version 5.x. and
catmandu import...
andcatmandu export...
doesn't work anymore. The import fails without a warning.Env:
Error: