jprante / elasticsearch-analysis-naturalsort

Natural sort plugin for Elasticsearch
https://jprante.github.io/elasticsearch-analysis-naturalsort/
Apache License 2.0
38 stars 19 forks source link

MapperParsingException: Analyzer [naturalsort] not found for field [sort] #11

Open chopachom opened 8 years ago

chopachom commented 8 years ago

Hi, I'm running ES 1.7 at OS X 10.9 installed via homebrew, I've installed the plugin

➜ /usr/local/opt/elasticsearch/bin/plugin -install analysis-naturalsort -url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-analysis-naturalsort/1.7.0.0/elasticsearch-analysis-naturalsort-1.7.0.0-plugin.zip
-> Installing analysis-naturalsort...
Trying http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-analysis-naturalsort/1.7.0.0/elasticsearch-analysis-naturalsort-1.7.0.0-plugin.zip...
Downloading ....DONE
Installed analysis-naturalsort into /usr/local/var/lib/elasticsearch/plugins/analysis-naturalsort

Then I've restarted ES and checked that plugin is installed:

{
  "cluster_name": "elasticsearch_brew",
  "nodes": {
    "o5naCtYRTxC3WoYUDNRowA": {
      "name": "Valkin",
      "transport_address": "inet[/127.0.0.1:9300]",
      "host": "qweqwe.local",
      "ip": "127.0.0.1",
      "version": "1.7.5",
      "build": "00f95f4",
      "http_address": "inet[/127.0.0.1:9200]",
      "plugins": [
        {
          "name": "analysis-naturalsort-1.7.0.0-6ce6cfd",
          "version": "1.7.0.0",
          "description": "Natural Sort Key Analysis",
          "jvm": true,
          "site": false
        },
        {
          "name": "head",
          "version": "NA",
          "description": "No description found.",
          "url": "/_plugin/head/",
          "jvm": false,
          "site": true
        }
      ]
    }
  }
}

But when I try to add mappings I get .MapperParsingException:

[2016-06-19 22:57:18,169][INFO ][node                     ] [Andrew Chord] stopping ...
[2016-06-19 22:57:18,215][INFO ][node                     ] [Andrew Chord] stopped
[2016-06-19 22:57:18,215][INFO ][node                     ] [Andrew Chord] closing ...
[2016-06-19 22:57:18,222][INFO ][node                     ] [Andrew Chord] closed
[2016-06-19 22:57:27,503][INFO ][node                     ] [Valkin] version[1.7.5], pid[51383], build[00f95f4/2016-02-02T09:55:30Z]
[2016-06-19 22:57:27,503][INFO ][node                     ] [Valkin] initializing ...
[2016-06-19 22:57:27,564][INFO ][plugins                  ] [Valkin] loaded [analysis-naturalsort-1.7.0.0-6ce6cfd], sites [head]
[2016-06-19 22:57:27,594][INFO ][env                      ] [Valkin] using [1] data paths, mounts [[/ (/dev/disk1s2)]], net usable_space [50.9gb], net total_space [216.7gb], types [hfs]
[2016-06-19 22:57:29,559][INFO ][node                     ] [Valkin] initialized
[2016-06-19 22:57:29,559][INFO ][node                     ] [Valkin] starting ...
[2016-06-19 22:57:29,626][INFO ][transport                ] [Valkin] bound_address {inet[/127.0.0.1:9300]}, publish_address {inet[/127.0.0.1:9300]}
[2016-06-19 22:57:29,649][INFO ][discovery                ] [Valkin] elasticsearch_brew/o5naCtYRTxC3WoYUDNRowA
[2016-06-19 22:57:33,558][INFO ][cluster.service          ] [Valkin] new_master [Valkin][o5naCtYRTxC3WoYUDNRowA][qweqwe.local][inet[/127.0.0.1:9300]], reason: zen-disco-join (elected_as_master)
[2016-06-19 22:57:33,576][INFO ][http                     ] [Valkin] bound_address {inet[/127.0.0.1:9200]}, publish_address {inet[/127.0.0.1:9200]}
[2016-06-19 22:57:33,576][INFO ][node                     ] [Valkin] started
[2016-06-19 22:57:33,603][INFO ][gateway                  ] [Valkin] recovered [2] indices into cluster_state
[2016-06-19 22:57:34,031][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] deleting index
[2016-06-19 22:57:34,169][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2016-06-19 22:57:35,207][INFO ][cluster.metadata         ] [Valkin] closing indices [[kabam_dev]]
[2016-06-19 22:57:35,231][INFO ][cluster.metadata         ] [Valkin] opening indices [[kabam_dev]]
[2016-06-19 22:57:35,317][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [users]
[2016-06-19 22:57:35,326][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [events]
[2016-06-19 22:57:35,337][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [links]
[2016-06-19 22:57:35,346][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [notes]
[2016-06-19 22:57:35,367][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [files]
[2016-06-19 22:57:35,376][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [messages]
[2016-06-19 22:57:35,385][INFO ][cluster.metadata         ] [Valkin] [kabam_dev] create_mapping [questions]
[2016-06-19 22:57:35,391][DEBUG][action.admin.indices.mapping.put] [Valkin] failed to put mappings on indices [[kabam_dev]], type [groups]
org.elasticsearch.index.mapper.MapperParsingException: Analyzer [naturalsort] not found for field [sort]
        at org.elasticsearch.index.mapper.core.TypeParsers.parseField(TypeParsers.java:216)
        at org.elasticsearch.index.mapper.core.StringFieldMapper$TypeParser.parse(StringFieldMapper.java:153)
        at org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField(TypeParsers.java:296)
        at org.elasticsearch.index.mapper.core.StringFieldMapper$TypeParser.parse(StringFieldMapper.java:184)
        at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:290)
        at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:214)
        at org.elasticsearch.index.mapper.object.RootObjectMapper$TypeParser.parse(RootObjectMapper.java:136)
        at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:211)
        at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:192)
        at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:449)
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:505)
        at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:374)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:204)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:167)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Any additional configuration is required beyond just installing the plugin?

dizzus commented 8 years ago

Same here. I'm running ES 1.7.5 on OSX 10.9 and getting the same error: {"error":"MapperParsingException[mapping [street]]; nested: MapperParsingException[Analyzer [naturalsort] not found for field [sort]]; ","status":400}

jprante commented 7 years ago

ES 1.x has many bugs regarding shard initialization and the pick up of correct mappings. Please update to ES 2.x+ and post your index settings and mappings (GET /indexname/_settings and GET /indexname/_mapping) if the issue still persists.