【发布时间】:2018-08-01 10:49:05
【问题描述】:
我想问一下如何通过简单的1个字符A-Z
用弹性搜索过滤特定数据所以..例如我得到了数据
- 橙色
- 苹果
- 古代
- 斧头
我想获取所有以字符开头(不包含)的结果,例如 "A"。所以结果是
- 苹果
- 古代
- 斧头
我在这里发现我应该创建新的分析器 Analyzer_startswith 并像这样设置。做错了什么?现在我得到 0 个结果
Elastica .yml 配置
fos_elastica:
clients:
default: noImportantInfo
indexes:
bundleName:
client: default
finder: ~
settings:
index:
analysis:
analyzer:
analyzer_startswith:
type: custom
tokenizer: keyword
filter:
- lowercase
types:
content:
properties:
id:
type: integer
elasticaPriority:
type: integer
title:
type: string
analyzer: another_custom_analyzer
fields:
raw:
type: string
index: not_analyzed
title_ngram:
type: string
analyzer: analyzer_startswith
property_path: title
谢谢
【问题讨论】:
标签: elasticsearch doctrine-orm symfony-2.1