I am busy implementing elasticsearch for a customer project. Elasticsearch seems pretty powerful and has a neat API.
Integrated with FOSElasticaBundle i have the following configuration:
fos_elastica:
clients:
default:
host: localhost
port: 9200
indexes:
app:
client: default
settings:
index:
analysis:
filter:
synonym:
type: synonym
synonyms: ["katze, katz"]
analyzer:
synonyms:
tokenizer: standard
filter: [ lowercase, synonym ]
types:
article:
mappings:
name: { analyzer: synonyms }
shortDescription: ~
description: ~
categories:
type: "nested"
properties:
name: ~
persistence:
driver: orm
model: ShopBundle\Entity\Catalog\Article
provider: ~
finder: ~
listener: ~
When i search for "Katze" (German for cat), i get the expected results (Articles having the string "Katze" in its name. When i search for "Katz", i get 0 results.
This is a simpler configuration then i really use. I tried it with nGram tokenizer and other custom analyzers... I don't get rid of the feeling that elastic isn't indexing the field with analyzed content.
When i use the "_analyze" API endpoint, and i send a string and the analyzer name (one of my custom analyzers), the result (list of tokens) looks right!
Do i miss something?
Version of FOSElastica is 4.0.1 and elasticsearch server 5.6.3.