简体   繁体   中英

Setting up elasticsearch on windows os?

I have gone through tutorials of ES but not able to configure it on my system.

I install ES,cURL,JSON view and is working fine. I am not able to install sense plugin for chrome as it says moved to marvel and from there no link to download.

I tried:

curl -X PUT "localhost:9200/test_idx_1x"

And index get created. Then i tried :

curl -X PUT "localhost:9200/test_idx_1x/test_mapping_1x/_mapping" -d '{
  "test_mapping_1x": {
    "properties": {
      "my_attachments": {
        "type": "attachment"
      }
    }
  }
}'

It's throwing NullPointerException .

What I need to do to run ES for flat file, Could anyone please guide me with simple steps?

ERROR:

2014-03-20 12:01:02,517][DEBUG][action.admin.indices.mapping.put] [Madelyne Pryor] failed to put mappings on indices [[test_idx_1x]], type [test_mapp
ng_1x]
ava.lang.NullPointerException
       at org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:117)
       at org.elasticsearch.common.xcontent.XContentHelper.convertToMap(XContentHelper.java:113)
       at org.elasticsearch.common.xcontent.XContentHelper.convertToMap(XContentHelper.java:101)
       at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:177)
       at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:387)
       at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:377)
       at org.elasticsearch.cluster.metadata.MetaDataMappingService$5.execute(MetaDataMappingService.java:540)
       at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:308)
       at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor
java:134)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

Also add the header with your command:

-H "Content-Type: application/json"

If still doesn't work, then wrap your json with double quotes instead of single. For example:

-d "{\"test_mapping_1x\" :\"...\"}"

I got this error when trying to do a mapping from Git Bash shell on Windows.

The same command run natively in Windows cmd.exe worked fine (sadly).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM