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.

LowLevel Support for using PUT to set Settings and Mappings at same time

See original GitHub issue

I am trying to set up an Edge NGram Tokenizer on my index. I currently create the index mapping using Client.LowLevel.IndicesPutMappingPost which I get from a .json file.

I was hoping to add Settings to this .json file and submit them along with the mapping in one shot.

Example from Documentation:

PUT my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "autocomplete": {
          "tokenizer": "autocomplete",
          "filter": [
            "lowercase"
          ]
        },
        "autocomplete_search": {
          "tokenizer": "lowercase"
        }
      },
      "tokenizer": {
        "autocomplete": {
          "type": "edge_ngram",
          "min_gram": 2,
          "max_gram": 10,
          "token_chars": [
            "letter"
          ]
        }
      }
    }
  },
  "mappings": {
    "doc": {
      "properties": {
        "title": {
          "type": "text",
          "analyzer": "autocomplete",
          "search_analyzer": "autocomplete_search"
        }
      }
    }
  }
}

I tried using Client.LowLevel.IndexPut but this requires a type, which is not allowed in the example above.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Mpdreamzcommented, Feb 5, 2019

You’re absolutely one of the use cases of the low level client, I am beyond happy you found a home there even when the high level client was not your cup of tea 👍 💯

1reaction
Mpdreamzcommented, Dec 28, 2016

PUT my_index

Is exposed under client.LowLevel.IndicesCreate

IndexPut is a PUT operation on /index/type/id e.g the Index API

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#_automatic_id_generation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure an index using a low level rest Client
I want to create a new index and to do this I am following the ... indexSettings = Settings.builder() .put("index.number_of_shards", ...
Read more >
Index mapping request in ElasticSearch using NEST in C# ...
To make a call with the low level client to create an index and mapping at the same time var client = new...
Read more >
Low-level Python client
This getting started guide illustrates how to connect to OpenSearch, index documents, and run queries. For the client source code, see the opensearch-py...
Read more >
Mappings and field types
This section provides an example for how to create an index mapping and how to add a document to it that will get...
Read more >
Hibernate Search 6.2.1.Final: Reference Documentation
Hibernate Search, full text search for your entities - Reference Documentation.
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