Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom index-level metadata #1649

Closed
ejain opened this issue Jan 29, 2012 · 12 comments
Closed

Custom index-level metadata #1649

ejain opened this issue Jan 29, 2012 · 12 comments
Labels

Comments

@ejain
Copy link
Contributor

ejain commented Jan 29, 2012

Provide a way to attach metadata to an index, similar to what can be
done with type mappings.

@alambert
Copy link
Contributor

alambert commented Feb 8, 2012

Is this what you're looking for? http://www.elasticsearch.org/guide/reference/mapping/meta.html

@ejain
Copy link
Contributor Author

ejain commented Feb 8, 2012

No, that's the type-mapping-level meta data I referred to.

@alexliu68
Copy link

I attach a pull @ #2378

@alexliu68
Copy link

create index with custom meta

{
"settings" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
},
"custom_meta" : {
"name1" : "value1",
"name2" : { "attr1": "value1", "attr2":"value2"},
"name3" : number
}
}

delete
/{index}/_custom_meta
/{index}/_custom_meta/{name}

put
/{index}/_custom_meta/{name}

get
/{index}/_custom_meta
/{index}/_custom_meta/{name}

@clintongormley
Copy link

Perhaps something that could be supported via index settings?

@clintongormley
Copy link

After discussion, this could simply be implemented by using a type meta and storing one document in it. Closing

@elwerene
Copy link

@clintongormley Elasticsearch removed the support for having multible types in an index starting in version 6.0.
Do you have any updated advise for storing per-index metadata?

@brusic
Copy link
Contributor

brusic commented Jan 24, 2018

As Clinton mentioned, you can use the meta field.

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-meta-field.html

@elwerene
Copy link

@brusic is it a cheap operation? At the moment I update a meta document inside a bulk request to make sure the meta data is en par with my indexed data. So I would make an index update for every indexed document..

@brusic
Copy link
Contributor

brusic commented Jan 24, 2018

First of all, I was slightly mistaken in my previous statement. Clinton referred to a meta type, not the now official meta field (which did not exist at the time).

I have never used the meta field since they were introduced years after this issue was open and I found other alternatives. I would assume that the meta field is added to the cluster state, which could make this an expensive operation. The cluster state needs to propagate new differences to other nodes in the cluster, which I think would make it slower than simply indexing a document (since there is no buffering and whatnot).

@elwerene
Copy link

Thanks for the precise answer!

I'll use a seperate index for the index metadata as it's possible to index/update documents in different indices at the same time with a bulk request.

@etki
Copy link
Contributor

etki commented Nov 16, 2018

@clintongormley i would like to put my vote on implementing index-level meta. I guess a lot of ES users would love to attach some data about index to index itself (mapping version so ingesters would know which encoder they should use; creation time; node that created index; list of forced refreshes/merges; list of manual interventions; etc, etc), i think it would be as useful as per-document _meta field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants