elasticsearch-plugin

is there any way to import a json file(contains 100 documents) in elasticsearch server.?

感情迁移 提交于 2019-12-17 15:34:31
问题 Is there any way to import a JSON file (contains 100 documents) in elasticsearch server? I want to import a big json file into es-server.. 回答1: You should use Bulk API. Note that you will need to add a header line before each json document. $ cat requests { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } } { "field1" : "value1" } $ curl -s -XPOST localhost:9200/_bulk --data-binary @requests; echo {"took":7,"items":[{"create":{"_index":"test","_type":"type1","_id":"1","_version

How to index a pdf file in Elasticsearch 5.0.0 with ingest-attachment plugin?

99封情书 提交于 2019-12-17 10:32:39
问题 I'm new to Elasticsearch and I read here https://www.elastic.co/guide/en/elasticsearch/plugins/master/mapper-attachments.html that the mapper-attachments plugin is deprecated in elasticsearch 5.0.0. I now try to index a pdf file with the new ingest-attachment plugin and upload the attachment. What I've tried so far is curl -H 'Content-Type: application/pdf' -XPOST localhost:9200/test/1 -d @/cygdrive/c/test/test.pdf but I get the following error: {"error":{"root_cause":[{"type":"mapper_parsing

ElasticSearch 5: MapperParserException while Inserting data

╄→尐↘猪︶ㄣ 提交于 2019-12-13 20:25:58
问题 My initial mapping was { "vehiclemodel": { "properties": { "price": { "type": "double" } } } } Later I updated the mapping with below { "vehiclemodel": { "properties": { "price": { "type": "double", "fields": { "exShowroomPrice": { "type": "double" } } } } } } Now when I add Data1 it getting added, but when I add Data2 it throws below exception Data1 : { "price": 36992043 } Data2 : { "price": { "exShowroomPrice": 36992043 } } Exception : { 'index': { '_index': 'notes', '_type': 'vehiclemodel'

Copy data from one index to another in elastic search

与世无争的帅哥 提交于 2019-12-13 08:40:50
问题 How to copy data from one index to another index in Elastic Search (which may be present in same host or different host) ? Output Reading config file {:file=>"logstash/agent.rb", :level=>:debug, :line=>"309", :method=>"local_config"} Compiled pipeline code: @inputs = [] @filters = [] @outputs = [] @periodic_flushers = [] @shutdown_flushers = [] @input_elasticsearch_1 = plugin("input", "elasticsearch", LogStash::Util.hash_merge_many({ "hosts" => ("input hostname") }, { "port" => ("9200") }, {

Elastic search+grails throwing NPE

社会主义新天地 提交于 2019-12-13 06:05:05
问题 This is in followup to this question Grails elasticsearch plugin with "text" mapping I followed the steps given in the answer and now following NPE is thrown. Also, if I open the lucene index using Luke then I do not see any documents in it.. Though while restarting the app server gives me following debug messages 2013-06-03 16:20:49,364 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Retrieved index settings 2013-06-03 16:20:49,365 [localhost-startStop-1] DEBUG

NEST elasticsearch.NET search query not returning results (part 2)

让人想犯罪 __ 提交于 2019-12-13 04:48:55
问题 I'm using the object initializer syntax with NEST to form a search query. When I include the second pdfQuery with the logical OR operator, I get no results. If I exclude it, I get results. QueryContainer titleQuery = new MatchQuery { Field = Property.Path<ElasticBook>(p => p.Title), Query = query, Boost = 50, Slop = 2, MinimumShouldMatch = "55%" }; QueryContainer pdfQuery = new MatchQuery { Field = Property.Path<ElasticBook>(p => p.Pdf), Query = query, CutoffFrequency = 0.001 }; var result =

Using Elastic Search to retrieve tag contents and hyphenated words

ⅰ亾dé卋堺 提交于 2019-12-13 01:11:01
问题 We have elastic search configured with a whitespace analyzer in our application. The words are tokenized on whitespace, so a name like <fantastic> project is indexed as ["<fantastic>", "project"] and ABC-123-def project is indexed as ["ABC-123-def", "project"] When we then search for ABC-* the expected project turns up. But, if we specifically search for <fantastic> it won't show up at all. It's as though Lucene/Elastic Search ignores any search term that includes angle brackets. However, we

ElasticSearch and searching on multiple fields in PHP

穿精又带淫゛_ 提交于 2019-12-12 13:23:41
问题 I am using the latest version of elasticsearch-php as well as the latest version of MongoDB and ElasticSearch. I need to do a search on multiple fields that can contain one or multiple values. Example: country_code should be either NL, BE or DE AND category should contain be AA01, BB01, CC02 or ZZ11 I thought I would solve it as followed (PHP): $countries = array(“NL”, “BE”, “DE”); $category = array(“AA01”, “BB01”, “CC02”, “ZZ11”); $searchParams['body']['query']['bool']['must']['terms'][

extracting data from multiple events from Elasticsearch using single logstash filter

人走茶凉 提交于 2019-12-12 05:28:27
问题 I have log lines loaded in ElasticSearch which has the data scattered in multiple events, say event_id is in event (line) number 5 and event_action is available in event number 88, further event_port information is available in event number 455. How can i extract this data so that my output looks like following. For this case multiline codec will not work. { event_id: 1223 event_action: "socket_open" event_port: 76654 } Currently I have the log files persisted so i can get the file path from

How to get all aggregations by avoiding 1 filter from the elasticsearch query

房东的猫 提交于 2019-12-12 04:59:25
问题 I have an elasticsearch query which gets aggregations from the query results. The aggregations work fine because if i select to get all dresses from "women fashion" category that are golden in color. The aggregations are working fine as it only returns the color golden. But logically we need all the colors in that aggregation. On the frontend filter we are directly showing records from the aggregations requests. Right now On the frontend when someone selects "golden" color, it drills down and