ElasticSearch

Java旅游点评项目笔记之项目搭建和实现

我与影子孤独终老i 提交于 2021-02-11 20:32:05
不点蓝字,我们哪来故事? 驴窝窝旅游点评项目 项目目的 项目的理解和技术技巧的熟练使用;月薪可达8K水平; 对原来技术的掌握,项目中的技术请无死角掌握; 想一下项目可以怎么去拓展,去实现新功能; 独立完成新的需求,举一反三;自主学习,自主思考;不要局限于老师讲的; 对技术需求的理解和掌握,怎么用好工具完成需求; 易忘,要在固定的时间复习; 1, 项目的总体安排 ; 2, 项目的重点 : 1,本项目的重点不是去制作一个完整旅游点评项目,而是了解整个旅游点评项目各个流程和需求,对实际项目开发有一个较为深刻的理解; 2,掌握项目中的一些重要的第三方工具/框架;比如bootstrap;uploadify;ueditor;等的使用; 3,掌握提升自我价值的知识点;比如redis,dubbo,mongodb,elasticsearch 4,掌握如何从0到1开发项目。 3, 项目的学习方法 : 1,深入学习和理解项目的需求,和一个产品的设计理念; 2,这个项项目,重点不要纠结于细节的代码实现,要从更大的范围去理解一个项目/产品的开发过程; 3,理解项目中的相关业务流程,学会自己去阅读第三方开发文档等(分享/第三方登录/短信发送); 4,从原理上掌握更高级的工具的使用,重点是要理解,什么时候需要用到这些东西,和使用这些东西的基本方式; 演示项目 技术路线 我们在做架构的时候并没有讲到SSH,SSM

Elastic search filter based on array of object

人盡茶涼 提交于 2021-02-11 18:23:29
问题 Below is mapping which i have { "defaultBoostValue":1.01, "boostDetails": [ { "Type": "Type1", "value": 1.0001 }, { "Type": "Type2", "value": 1.002 }, { "Type": "Type3", "value": 1.0005 } ] } I want to apply boost type based on type , so if boostType is Type3 then boostFactor should be 1.0005, and if it does not have that boostType, it should apply "defaultBoostValue" as boost below is the query which i have tried { "query": { "function_score": { "boost_mode": "multiply", "functions": [ {

Running python script in Service account by using windows task scheduler

微笑、不失礼 提交于 2021-02-11 16:43:38
问题 NOTE 1- All files are running using cmd in my profile and fetching correct results.But not with the windows task scheduler. **> NOTE 2- I finally got a lead that glob.glob and os.listdir is not working in the windows task scheduler in my python script in which I am making a connection to a remote server, but it is working in my local using cmd and pycharm.** ** print("before for loop::", os.path.join(file_path, '*')) print(glob.glob( os.path.join(file_path, '*') )) for filename in glob.glob(

How to set default mapping to “keyword” for dynamically added properties in Elasticsearch

 ̄綄美尐妖づ 提交于 2021-02-11 15:31:27
问题 In our application we add new documents which can have new unknown properties. Is it possible to set default mapping to "keyword" for dynamically added new properties in Elasticsearch? 回答1: Dynamic template doc has an example for type string. Also in case you don't already use index templates read the relevant doc as the dynamic template can be specify with CREATE INDEX API but more commonly in the index template 回答2: This, this, and this should be enough to get you started. When in doubt,

elasticsearch6.1.1中curl操作索引

為{幸葍}努か 提交于 2021-02-11 15:29:18
新版的elasticsearch在使用curl创建索引的时候报错: :"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406 解决办法:指定请求头即可 curl -H "Content-Type: application/json" -XPUT 'http://127.0.0.1:9200/kc22k2_test' -d ' 实例: curl -H "Content-Type: application/json" -XPOST 'http://127.0.0.1:9200/kc22k2_test/cz' -d '{ "akc190" : { "type" : "string", "index" : "not_analyzed" }, "aac001" : { "type" : "string", "index" : "not_analyzed" }, "akc194" : { "type" : "date", "format": "dateOptionalTime" }, "id_drg" : { "type" : "string", "index" : "not_analyzed" }, "name_drg" : { "type" : "string",

java.lang.NoSuchMethodError: org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder.setSource

…衆ロ難τιáo~ 提交于 2021-02-11 15:15:23
问题 I am trying to run the spring boot parent project which uses child project, which in turn uses project(ES project) which has elasticsearch dependencies and elasticsearch config bean for transport client. The child project uses Spring Data ES repositories, which are enabled by a respective annotation in a project. These are config annotations used in the child: @Configuration @ComponentScan("package") @EntityScan("package3") @EnableJpaRepositories("package2") // enables only es repos for

ElasticSearch not working with same origin

。_饼干妹妹 提交于 2021-02-11 14:52:28
问题 I installed ElasticSearch on my Ubuntu server and it seems to be working correctly when I do the cURL command. However, when I use the ElasticSearch URI using Ajax I get the following error: net::ERR_BLOCKED_BY_CLIENT Here's how my Ajax request looks like: const QUERY_URL = "http://localhost:9200/topics/_search?q=name:" + QUERY + "*&sort=follower_count:desc&size=5"; $.ajax({ type: 'GET', url: QUERY_URL, success: function (data) { console.log(data); }, error: function (xhr) { if (xhr.status ==

ElasticSearch: obtaining individual scores from each query inside of a bool query

喜你入骨 提交于 2021-02-11 14:48:01
问题 Assume I have a compound bool query with various "must" and "should" statements that each may include different leaf queries including "multi-match" and "match_phrase" queries such as below. How can I get the score from individual queries packed into a single query? I know one way could be to break it down into multiple queries, execute each, and then aggregate the results in code-level (not query-level). However, I suppose that is less efficient, plus, I lose sorting/pagination/.... features

Search for array values except for a list of positions

回眸只為那壹抹淺笑 提交于 2021-02-11 14:37:52
问题 I have tens of millions of documents like the following. { id: "<some unit test id>", groupName: "<some group name>", result: [ 1, 0, 1, 1, ... 1 ] } Result field is an 200 array of numbers, 0 or 1. My job is to find, given a groupName, say, "group17" and a few numbers, say, 3, 8, 27 find all the document whose result array elements for the groupName are all equal to 1 disregarding the values at positions 3, 8, 27. Would appreciate if someone could point out if there is a quick search for it.

Spring data elasticsearch multiple filters

混江龙づ霸主 提交于 2021-02-11 14:33:28
问题 Considering the mappings (messages are nested type inside channel) @Document(indexName = "index", type = "channel") @Data public class Channel { @Id @Field(type = FieldType.Text) private String id; @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second_millis) @JsonFormat(shape = JsonFormat.Shape.STRING) private LocalDateTime issuedTimestamp; @Field(type = FieldType.Text) private String clientUsername; @Field(type = FieldType.Nested, includeInParent = true) private List