title: ElasticSearch how to search comma separated string inside comma separated fields?
body: <p>In a case I should search a comma separated string against a comma separated fields, because of this I do the following in mapping but show <code>MapperParsingException[Analyzer [comma] not found for field [conduct_days]]</code> error.</p>
  
  <pre><code>            $course = new Course();
              $course-&gt;no = '1231321';
              .......
              .......
              $course-&gt;save();
  
              // Now index the new created course
  
              $client = \Elasticsearch\ClientBuilder::create()-&gt;build();
  
  
  
  
              $params = [
                  'index' =&gt; 'my_index',
                  'type' =&gt; 'my_resources',
                  'body' =&gt; [
                      'my_resources' =&gt; [
                          '_source' =&gt; [
                              'enabled' =&gt; true
                          ],
                          'settings' =&gt; [
                              "analysis" =&gt; [
                                  "tokenizer" =&gt; [
                                      "comma" =&gt; [
                                          "type" =&gt; "pattern",
                                          "pattern" =&gt; ","
                                      ]
                                  ],
                                  "analyzer" =&gt; [
                                      "comma" =&gt; [
                                          "type" =&gt; "custom",
                                          "tokenizer" =&gt; "comma"
                                      ]
                                  ]
                              ]
                          ],
                          'properties' =&gt; [
                              'conduct_days' =&gt; array(
                                  'type' =&gt; 'string',
                                  'analyzer' =&gt; 'comma'
                              ),
                              'no' =&gt; array(
                                  'type' =&gt; 'string',
                                  'analyzer' =&gt; 'standard'
                              ),
                              'created_at' =&gt; array(
                                  'type' =&gt; 'date_time',
                                  "format"=&gt;"YYYY-MM-dd HH:mm:ss||MM/dd/yyyy||yyyy/MM/dd"
                              ),
                              'updated_at' =&gt; array(
                                  'type' =&gt; 'date_time',
                                  "format" =&gt; "YYYY-MM-dd HH:mm:ss||MM/dd/yyyy||yyyy/MM/dd"
                              ),
                              'deleted_at' =&gt; array(
                                  'type' =&gt; 'date_time',
                                  "format" =&gt; "YYYY-MM-dd HH:mm:ss||MM/dd/yyyy||yyyy/MM/dd"
                              ),
                              'created_by' =&gt; array(
                                  'type' =&gt; 'string',
                                  'analyzer' =&gt; 'standard'
                              ),
                              'updated_by' =&gt; array(
                                  'type' =&gt; 'string',
                                  'analyzer' =&gt; 'standard'
                              ),
                              'deleted_by' =&gt; array(
                                  'type' =&gt; 'string',
                                  'analyzer' =&gt; 'standard'
                              )
                          ]
                      ]
                  ]
              ];
  
              // Update the index mapping
              $client-&gt;indices()-&gt;putMapping($params);
  
              $params = [
                  'index' =&gt; 'promote_kmp',
                  'type' =&gt; 'courses',
                  'id' =&gt; uniqid(),
                  'body' =&gt; [
                      'id'                      =&gt; $course-&gt;id,
                      'conduct_days'            =&gt; $course-&gt;conduct_days,
                      'no'                      =&gt; $course-&gt;no,
                      'created_at'              =&gt; $course-&gt;created_at,
                      'created_by'              =&gt; $loggedInUser,
                  ]
              ];
              $client-&gt;index($params);
  </code></pre>
  
  <p>Suppose I have to search <code>1,3,5,7</code> inside the conduct days fields that can has <code>1,2</code> and <code>1,2,3</code>, and <code>1,3,5,6</code> and many more. For search I think I should explode the search term for example If search term is <code>1,2</code>, I should search two time, first for <code>1</code> and then for <code>2</code>. Any other solution for searching?</p>