0

I am using Nest to commuicate with ElasticSearch indexes.

Now, I am trying to add new type inside existing index :

    if (elasticClient.IndexExists("catalogindex").Exists)
        {
            var request = new TypeExistsRequest("catalogindex", "product");
            if (!elasticClient.TypeExists(request).Exists)
            {
               //here I want to add the mapping for my product type
            }
        }

So Is there any method I can use to do that?

P.S

I know that there is CreateIndex() method but what if I want to add new type to that index without recreating the whole index.

9
  • I'd advised against doing so because ES 6 (released two days ago) won't allow to have more than one type per index so your code would not be forward compatible when you upgrade to ES 6. Commented Nov 17, 2017 at 13:53
  • I have read here stackoverflow.com/questions/14465668/… that there are some trade-offs of having multiple types over one per index!! Commented Nov 17, 2017 at 13:58
  • Yes, but that question is 4 years old and in ES 6 it won't be possible anymore, so the question won't stand anymore. Commented Nov 17, 2017 at 14:01
  • @Val another thing they have mentioned that indexes built using versions 5.x will still work but you cannot have multiple types per index . and what if indexes are built using versions < 4.x? Commented Nov 17, 2017 at 14:02
  • @Val And does that mean they will remove the concept of type, because of the fact that every single index has one single type? Commented Nov 17, 2017 at 14:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.