【发布时间】:2015-04-29 23:56:21
【问题描述】:
当我尝试将“not_analyzed”应用到我的 ES 映射时,它不起作用。
我在 Laravel 中为 ES 使用这个包 - Elasticquent
我的映射如下:
'ad_title' => [
'type' => 'string',
'analyzer' => 'standard'
],
'ad_type' => [
'type' => 'integer',
'index' => 'not_analyzed'
],
'ad_type' => [
'type' => 'integer',
'index' => 'not_analyzed'
],
'ad_state' => [
'type' => 'integer',
'index' => 'not_analyzed'
],
之后我调用 API 来查看映射,它会输出:
"testindex": {
"mappings": {
"ad_ad": {
"properties": {
"ad_city": {
"type": "integer"
},
"ad_id": {
"type": "long"
},
"ad_state": {
"type": "integer"
},
"ad_title": {
"type": "string",
"analyzer": "standard"
},
"ad_type": {
"type": "integer"
},
请注意 not_analyzed 缺失。 我的日志中也看不到任何错误/警告。
【问题讨论】:
-
我没有发现任何问题,数字未分析(elasticsearch.org/guide/en/elasticsearch/reference/current/…)并且
ad_title具有正确的分析器。您是否尝试过在没有分析器的情况下输入string字段并且没有工作? -
@dimzak 是的,但是 'index' => 'not_analyzed' 应该在之后在映射上进行输出时出现。我在堆栈上看到了另一个线程,其中一个人通过 _mapping?pretty 打印了他的映射。在他的身上,'index' => 'not_analyzed' 显示了
标签: php mysql apache laravel elasticsearch