Search elastic4s search filter mode

Now we can start to explore the core part of es: search. Search has two modes: filter and query. Filter mode is the filter mode: find the records that meet the filter conditions as the results. Query mode is divided into two steps: first filter, and then calculate the similarity of each eligible record. It's just a lot of scoring. If we want to ...

Added by phppaper on Sun, 26 Apr 2020 16:51:34 +0300

Flink: take away all State and go far away: State initial

State: State refers to the intermediate calculation result or metadata attribute of the calculation node in the process of flow calculation. For example, in the process of aggregation, the intermediate aggregation result should be recorded in the state. For example, when Apache Kafka is the data sourc ...

Added by CanMan2004 on Wed, 04 Mar 2020 11:19:04 +0200

"Class - Basic Concepts 2" Learned by Scala

Internal Class import scala.collection.mutable.ArrayBuffer class Class { class Student(val name: String) {} //Internal class here val students = new ArrayBuffer[Student] def getStudent(name: String) = { new Student(name) } } val c1 = new Class val s1 = c1.getStudent("0mifang") c1.students += s1 val c2 = new Class val s2 = c2.getStudent ...

Added by zzz on Wed, 22 Jan 2020 06:12:18 +0200

Scala's mapping and tuple operations

Mapping and tuple operations Construction of Map // To construct an immutable MAP map, a combination like key - > value is called dual val score = Map("Jack" -> 12, "Bob" -> 20) // You can also create a Map map in this way val score1 = Map(("Jack", 12), ("Bob", 20)) // Get value according to key, similar to map.ge ...

Added by robert_gsfame on Sat, 04 Jan 2020 20:02:21 +0200

Resolution of jackson version conflict in spark application

In the spark program, jackson is used to do json serialization and deserialization of scala objects. There are java.lang.NoClassDefFoundError and java.lang.AbstractMethodError errors at runtime. After searching the Internet, it is found that the version conflicts between jackson/guava and spark. 1. In idea, by adjusting the order of dependencie ...

Added by DocSeuss on Sun, 15 Dec 2019 17:06:15 +0200

Small problems of Scala multithreading in spark process

This time, we changed the source code of ThriftServer and added some services. In the middle of the change, we encountered such a problem. When we submitted tasks asynchronously, we wanted to make them multithreaded. At the beginning, we used scala's Actor, which passed sqlcontext and sql. We found that every sparkSessionId cha ...

Added by 88fingers on Wed, 11 Dec 2019 17:15:14 +0200

Scala development environment construction

At the beginning, I used eclipse development tools. After installing Scala, download the Scala Eclipse Plug-in and copy the feature s and plugin s in the compression package to the corresponding directory of eclipse tools. However, using Eclipse Maven to develop Scala projects is a bit of a pain. So, toss to toss to give up and ...

Added by AjithTV on Mon, 09 Dec 2019 03:52:28 +0200

Group by operation of text data according to fields

Demand: The text data format is as follows: akc190|id_drg|name_drg|pdxCode|pdxName|sdxCodes|sdxNames|yka055 0001369157| 101| seizure (-) | G40.901| epilepsy | G40.901 $| epilepsy $| 1946.56 0001370448| 101| seizure (-) | G40.901| epilepsy | G40.901$J40.x00 $| epilepsy $bronchitis $| 2842.77 0001374918| 101| seizure (-) | R56.001| febrile c ...

Added by CroNiX on Sun, 08 Dec 2019 01:39:30 +0200

Scala basic syntax

Definition of if expression: in Scala, if expression has value, which is the return value of the last statement in if or else expression. object IfDemo { def main(args: Array[String]): Unit = { val age = 28 val isAdult = if (age > 25) 1 else 0 println(isAdult) } } Type inference of if expression: because if ...

Added by web_noob on Wed, 20 Nov 2019 11:39:58 +0200

Restapi-caching, akka-http cache

restapi serves as a hub for front-end and back-end interaction: in the face of a large number of front-end requests, you need to ensure timely responses.Using caching is an effective tool.We can cache the response of most front-end requests, especially those that require a lot of computation to obtain, which can greatly improve the response spe ...

Added by Fireglo on Mon, 11 Nov 2019 08:40:33 +0200