question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting settings?

See original GitHub issue

How can we use elasticsearch-js to set settings?

I assumed that this would work

var settings = {
    "index":{
        "analysis":{
            "analyzer":{
                "inurl_analyzer": {
                    "tokenizer":"ngram",
                    "filter":"lowercase"
                }
            },
            "tokenizer":{
                "ngram": {
                    "type": "ngram",
                    "min_gram": 3,
                    "max_gram": 50
                }
            }
        }
    }
};
client.indices.putSettings(settings, ...)

But then we get an error:

TypeError: Invalid index: expected be a comma seperated list, array, number or string.

When, this works flawlessly:

curl -X PUT "http://localhost:9200/superfeedr" -d '{
    "settings":{
        "index":{
            "analysis":{
                "analyzer":{
                    "inurl_analyzer": {
                        "tokenizer":"ngram",
                        "filter":"lowercase"
                    }
                },
                "tokenizer":{
                    "ngram": {
                        "type": "ngram",
                        "min_gram": 3,
                        "max_gram": 50
                    }
                }
            }
        }
    }
}'

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
julien51commented, Sep 8, 2014

Ok, for posterity what worked was indeed creating the index, with a body:

client.indices.create({index: 'superfeedr', body: settings}
1reaction
spalgercommented, Sep 8, 2014

The curl request is different because it specifies an index name. I expect you will get the same result if you tell the js client the index to work with:

client.indices.putSettings({
  index: 'superfeedr',
  body: settings
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Settings App - Apps on Google Play
Different apps need different configurations and settings. This app help you to switch to different set of settings for your each of your...
Read more >
Change settings quickly on your Android phone
From the top of your screen, swipe down twice. · At the bottom left, tap Edit . · Touch and hold the setting....
Read more >
Setting vs Settings? Which one makes more sense in a ...
Setting is singular, so use it if you only have one thing to set. Settings is plural, so use it when you have...
Read more >
Find settings on iPhone - Apple Support
In the Settings app , you can search for iPhone settings you want to change, such as your passcode, notification sounds, and more....
Read more >
8 Hidden Android Settings You Should Change Right Now!
Android users, this video is for you. 8 hidden, cool Android settings that you should be changing right away and trust me, these...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found