After using the Elasticsearch JDBC Importer, 'asciifolding' is not working as expected
<p>Using the Elasticsearch JDBC importer with this configuration:</p>

<pre><code>bin=/usr/share/elasticsearch/elasticsearch-jdbc-2.1.1.2/bin
lib=/usr/share/elasticsearch/elasticsearch-jdbc-2.1.1.2/lib
echo '{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "ip/db",
        "user" : "myuser",
        "password" : "a7sdf7hsdf8hn78df",
        "sql" : "SELECT title, body, source_id, time_order, type, blablabla...",
        "index" : "importeditems",
        "type" : "item",
        "elasticsearch.host": "_eth0_",
        "detect_json" : false
    }
}' | java \
       -cp "${lib}/*" \
       -Dlog4j.configurationFile=${bin}/log4j2.xml \
       org.xbib.tools.Runner \
       org.xbib.tools.JDBCImporter
</code></pre>

<p>I've indexed some documents correctly with the form:</p>

<pre><code>{
"title":"Tiempo de Opinión: Puede comenzar un ciclo",
"body":"Sebas Álvaro nos trae cada lunes historias y anécdotas de la montaña&lt;!-- com --&gt;",
"source_id":21188,
"time_order":"1438638043:55c2c6bb96d4c"
"type":"rss"
}
</code></pre>

<p>I'm trying to ignore the accents (for example, <code>opinión</code>in title has an <strong>ó</strong>), so if a user searches <code>"tiempo de opinión"</code> or <code>"tiempo de opinion"</code> with a <code>match_phrase</code> it gives a match with the documents with or without accent.</p>

<p>So after using the importer and indexing everything, I changed my index settings to <code>default</code>analyzer with an <code>asciifolding</code> filter.</p>

<pre><code>curl -XPOST 'localhost:9200/importeditems/_close'

curl -XPUT 'localhost:9200/importeditems/_settings?pretty=true' -d '{
    "analysis": {
      "analyzer": {
        "default": {
          "tokenizer" : "standard",
          "filter":  [ "lowercase", "asciifolding"]
}}}}'

curl -XPOST 'localhost:9200/importeditems/_open'
</code></pre>

<p>Then I make a <code>match_phrase</code> to match<code>"tiempo de opinion"</code> (no accent) and <code>"tiempo de opinión"</code> (with accent)</p>

<pre><code># No accent
curl -XGET 'localhost:9200/importeditems/_search?pretty=true' -d'
{
"query": {
            "match_phrase" : {
                 "title" : "tiempo de opinion"
}}}'

# With accent
curl -XGET 'localhost:9200/importeditems/_search?pretty=true' -d'
{
"query": {
            "match_phrase" : {
                 "title" : "tiempo de opinión"
}}}'
</code></pre>

<p>But no match is given when they exist (if I <code>match_phrase</code> the phrase <code>tiempo de</code> it returns some hits containing <code>tiempo de opinión</code>).</p>

<p>I think the problem is due to de JDBC Importer because I reproduced the error without using the importer, adding another index and entries by hand, changing the index settings also to <code>asciifolding</code> and everything works as expected. You can see this working example right <a href="http://pastebin.com/4ApJEtYC" rel="nofollow"><strong>here</strong></a>.</p>

<p>If I check the settings of the index created after using the importer (<code>importeditems</code>)</p>

<pre><code>curl -XGET 'localhost:9200/importeditems/_settings?pretty=true'
</code></pre>

<p>This outputs:</p>

<pre><code>{
  "importeditems" : {
    "settings" : {
      "index" : {
        "creation_date" : "1457533907278",
        "analysis" : {
          "analyzer" : {
            "default" : {
              "filter" : [ "lowercase", "asciifolding" ],
              "tokenizer" : "standard"
            }
          }
        },
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "x",
        "version" : {
          "created" : "2010199"
}}}}
</code></pre>

<p>... and if I check the settings of the manually created index (<code>test</code>):</p>

<pre><code>curl -XGET 'localhost:9200/test/_settings?pretty=true'
</code></pre>

<p>I get the same exact output:</p>

<pre><code> {
  "test" : {
    "settings" : {
      "index" : {
        "creation_date" : "1457603253278",
        "analysis" : {
          "analyzer" : {
            "default" : {
              "filter" : [ "lowercase", "asciifolding" ],
              "tokenizer" : "standard"
            }
          }
        },
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "x",
        "version" : {
          "created" : "2010199"
    }}}}
</code></pre>

<p>Can someone please tell why is not working if I use the Elasticsearch JDBC Importer and why is it working if I add raw data?</p>