5
votes

When indexing the entity(document) the default behavior is to index all the fields of the entity. By default source is enabled and store is disabled to all fields. But If I want to index some of the fields only instead of index all the fields, As I understood I have to disable the source and explicitly mark the fields as store yes.

Can I disable the source for document/entity using spring data elasticsearch? Does it support by annotations?

1

1 Answers

0
votes

If you just want to prevent a field from being indexed you can just add a field annotation like this:

@Field(store = false)
private YourObject yourObject