Removing request parameters in _analyze API
Remove unused imports Replace POST method by GET method in docs Add breaking changes explanation Fix small issue in Kuromoji docs Closes #20246
This commit is contained in:
parent
370f0b885e
commit
eca9894c5f
|
@ -22,13 +22,11 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
import org.elasticsearch.common.ParseFieldMatcher;
|
||||||
import org.elasticsearch.common.Strings;
|
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.common.xcontent.XContentType;
|
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
import org.elasticsearch.rest.RestRequest;
|
import org.elasticsearch.rest.RestRequest;
|
||||||
|
|
|
@ -19,25 +19,16 @@
|
||||||
package org.elasticsearch.rest.action.admin.indices;
|
package org.elasticsearch.rest.action.admin.indices;
|
||||||
|
|
||||||
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
|
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
import org.elasticsearch.common.ParseFieldMatcher;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.rest.RestChannel;
|
|
||||||
import org.elasticsearch.rest.RestRequest;
|
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.rest.FakeRestRequest;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
import static org.hamcrest.Matchers.notNullValue;
|
import static org.hamcrest.Matchers.notNullValue;
|
||||||
import static org.hamcrest.Matchers.startsWith;
|
import static org.hamcrest.Matchers.startsWith;
|
||||||
import static org.mockito.Mockito.doCallRealMethod;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
public class RestAnalyzeActionTests extends ESTestCase {
|
public class RestAnalyzeActionTests extends ESTestCase {
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ PUT icu_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST icu_sample/_analyze
|
GET icu_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "Elasticsearch. Wow!"
|
"text": "Elasticsearch. Wow!"
|
||||||
|
|
|
@ -175,7 +175,7 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "東京スカイツリー"
|
"text": "東京スカイツリー"
|
||||||
|
@ -232,7 +232,7 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "飲み"
|
"text": "飲み"
|
||||||
|
@ -298,7 +298,7 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "寿司がおいしいね"
|
"text": "寿司がおいしいね"
|
||||||
|
@ -375,13 +375,13 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "katakana_analyzer",
|
"analyzer": "katakana_analyzer",
|
||||||
"text": "寿司" <1>
|
"text": "寿司" <1>
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "romaji_analyzer",
|
"analyzer": "romaji_analyzer",
|
||||||
"text": "寿司" <2>
|
"text": "寿司" <2>
|
||||||
|
@ -433,13 +433,13 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "コピー" <1>
|
"text": "コピー" <1>
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "サーバー" <2>
|
"text": "サーバー" <2>
|
||||||
|
@ -452,7 +452,7 @@ POST kuromoji_sample/_analyze
|
||||||
|
|
||||||
|
|
||||||
[[analysis-kuromoji-stop]]
|
[[analysis-kuromoji-stop]]
|
||||||
===== `ja_stop` token filter
|
==== `ja_stop` token filter
|
||||||
|
|
||||||
The `ja_stop` token filter filters out Japanese stopwords (`_japanese_`), and
|
The `ja_stop` token filter filters out Japanese stopwords (`_japanese_`), and
|
||||||
any other custom stopwords specified by the user. This filter only supports
|
any other custom stopwords specified by the user. This filter only supports
|
||||||
|
@ -489,7 +489,7 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "analyzer_with_ja_stop",
|
"analyzer": "analyzer_with_ja_stop",
|
||||||
"text": "ストップは消える"
|
"text": "ストップは消える"
|
||||||
|
@ -514,7 +514,7 @@ The above request returns:
|
||||||
// TESTRESPONSE
|
// TESTRESPONSE
|
||||||
|
|
||||||
[[analysis-kuromoji-number]]
|
[[analysis-kuromoji-number]]
|
||||||
===== `kuromoji_number` token filter
|
==== `kuromoji_number` token filter
|
||||||
|
|
||||||
The `kuromoji_number` token filter normalizes Japanese numbers (kansūji)
|
The `kuromoji_number` token filter normalizes Japanese numbers (kansūji)
|
||||||
to regular Arabic decimal numbers in half-width characters. For example:
|
to regular Arabic decimal numbers in half-width characters. For example:
|
||||||
|
@ -539,7 +539,7 @@ PUT kuromoji_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST kuromoji_sample/_analyze
|
GET kuromoji_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "一〇〇〇"
|
"text": "一〇〇〇"
|
||||||
|
|
|
@ -82,7 +82,7 @@ PUT phonetic_sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POST phonetic_sample/_analyze
|
GET phonetic_sample/_analyze
|
||||||
{
|
{
|
||||||
"analyzer": "my_analyzer",
|
"analyzer": "my_analyzer",
|
||||||
"text": "Joe Bloggs" <1>
|
"text": "Joe Bloggs" <1>
|
||||||
|
|
|
@ -7,3 +7,7 @@ In previous versions of Elasticsearch, JSON documents were allowed to contain un
|
||||||
This feature was removed in the 5.x series, but a backwards-compability layer was added via the
|
This feature was removed in the 5.x series, but a backwards-compability layer was added via the
|
||||||
system property `elasticsearch.json.allow_unquoted_field_names`. This backwards-compability layer
|
system property `elasticsearch.json.allow_unquoted_field_names`. This backwards-compability layer
|
||||||
has been removed in Elasticsearch 6.0.0.
|
has been removed in Elasticsearch 6.0.0.
|
||||||
|
|
||||||
|
==== Analyze API changes
|
||||||
|
|
||||||
|
The deprecated request parameters and plain text in request body has been removed, use JSON in request body.
|
||||||
|
|
Loading…
Reference in New Issue