2

I need to add a timestamp path to my index using NEST, not sure how to make this happen: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html

I have been messing with NEST but I cannot figure this out.

I have been reading the docs here but have not found what i am looking for: http://nest.azurewebsites.net/nest/quick-start.html

1 Answer 1

4

Using the fluent API, this can be done when creating your index:

var response = client.CreateIndex("myindex", c => c
  .AddMapping<MyType>(m => m
    .MapFromAttributes()
    .TimestampField(t => t
      .SetDisabled(false)
      .SetPath(o => o.MyTimestampField)
    )
  )
);

Or updating an existing index:

var response = client.Map<MyType>(m => m
  .TimestampField(t => t
    .SetDisabled(false)
    .SetPath(o => o.MyTimestampField)
  )
);

Hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

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.