0
votes

I am not sure on how to map ES the right way for my Laravel app. Do I need both analyzer and index set?

eg:

index: analyzed or not_analyzed analyzer: standard

Also, when I want integers and dates to be searchable/filtered, is index - not_analyzed enough?

Eg:

string mapping:

type: string index: analyzed analyzer: standard

date:

type: date index: not_analyzed

Its unclear to me if I need to use both

index: analyzed and analyzer:standard

or if it is enought to just set index

1

1 Answers

2
votes

Have you gone through the ES documentation for mapping, analysis ? There is a pretty good documentation which explains when and why you should be using index analyzers and query analyzers.

ES will dynamically index all your fields and will use default analyzers for indexing and querying, so you should be good if you don't specify these mapping, unless you want to use specific analyzers for your text fields or different analyzers for indexing and querying.

This doc explains behavior for all the supported data types: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html

Analyzers and Mapping.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html

http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/mapping-analysis.html

http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/analysis-intro.html