[source, ruby]
----
response = client.indices.create(
  index: 'test',
  body: {
    settings: {
      analysis: {
        filter: {
          code: {
            type: 'pattern_capture',
            preserve_original: true,
            patterns: [
              '(\\p{Ll}+|\\p{Lu}\\p{Ll}+|\\p{Lu}+)',
              '(\\d+)'
            ]
          }
        },
        analyzer: {
          code: {
            tokenizer: 'pattern',
            filter: [
              'code',
              'lowercase'
            ]
          }
        }
      }
    }
  }
)
puts response
----
