Storing only pointer to source field?

Hi,
I'm new to Elasticsearch and am wondering about this: is there a handy way to not store the _source field (original json file), but instead store just a pointer (ID) to the source field items?

For instance if the _source field is very large, I'd like to only use it only for the original indexing, but not store it, and later when doing a search return the pointer to the matching items, so that I can still retrieve the original source items.

Can I set _source to be 'disabled' but in the meantime store certain fields?

Thank you very much!!

Welcome to our community! :smiley:

Take a look at synthetic _source, it might be what you want (but it has limits).

1 Like

Thank you so much Mark! I did see this 'synthetic_source' function before.

I'm actually wondering about: (1) what's actually lost if I set '_source' to be 'disabled'? (2) would you suggest some way to store my data in some databse while still being able to search and retrieve using elasticsearch?

Really appreciate it!!

Per that docs page I linked, it's anything that isn't listed under the section "Synthetic _source can be used with indices that contain only these field types:". So there's a few field types that aren't there, but they may not be relevant to your use case anyway.

You can store a reference to another system in Elasticsearch but you'd need to handle the connection between the reference and the external system yourself.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.