Reasons why elasticsearch cannot query Chinese fields through Java API and Solutions

Time:2022-1-7

Elasticsearch cannot query Chinese fields through Java API. Why:

When Chinese is segmented by the standard word splitter, it is natural that a complete field name cannot be queried

solve:

Add after the name parameter in the query method Keyword tells the program that this is a complete word and cannot be split
Reasons why elasticsearch cannot query Chinese fields through Java API and Solutions
Give me a big close-up
Reasons why elasticsearch cannot query Chinese fields through Java API and Solutions

Recommended Today

Springboot 2.6.3 integrated redis stepped on the pit

The integration steps are as follows: development tools: idea2019, JDK1.8, maven 3.5.4 Idea creates a new project, selects spring initializer, selects spring boot version 2.6.3 (the latest version at present), and adds web, and redis modules. After successful construction, the POM file is as follows: <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <parent> […]