elasticsearch-rails
elasticsearch-rails copied to clipboard
Documentation of "settings" and "mapping" method?
I see the example for defining settings and mapping for an index/model in the README of https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model:
class Article
settings index: { number_of_shards: 1 } do
mappings dynamic: 'false' do
indexes :title, analyzer: 'english', index_options: 'offsets'
end
end
end
However, I could not find a documentation for settings
and mapping
. This got me quite confused. For example, there is no easy way to tell that:
- The
dynamic
value has to be a String and not a boolean - The
indexes
method allows a block to create nested structures
It is also not shown in the documentation:
- Simple examples for
mapping
class method: https://rubydoc.info/gems/elasticsearch-model/Elasticsearch/Model/Indexing/ClassMethods:mapping - General overview of the
mapping
structure definesindexes
but there is no documentation
Would it make sense to at least expand the examples to show how the indexes
method can be used?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Ping, anyone?
Hi @slhck, Thanks for reporting this! We've installed the stale bot in this repository since there are issues from a long time ago, and I need to clean up the issues to know which ones are old/deprecated/no longer valid, etc. The issue won't be closed now there's been activity and I'll get to it as soon as possible.
Thanks for the feedback!
I also wonder about the difference between the examples below:
settings index: { number_of_shards: 1 } do
mappings dynamic: 'false' do
indexes :title, analyzer: 'english', index_options: 'offsets'
end
end
settings index: { number_of_shards: 1 }
mappings dynamic: 'false' do
indexes :title, analyzer: 'english', index_options: 'offsets'
end
What's the point of nesting mappings
inside settings
?
I can't find suitable documentation either.
I keep coming back to this issue, and the mapping
and setting
configuration still confuses me. I have, so far, been unable to simply provide my own mapping. I thought that supplying my own mapping would work:
def mapping
{
properties: {
geolocation: {
properties: {
latlon: {
type: "geo_point"
}
}
}
}
}
end
but alas, it does not pick that up when indexing.
Could anyone please update the documentation with a description of how these fields work?
Same here, I find it quite hard to figure out how to configure something like language specific stopwords using the DSL methods. Some more examples would be extremely helpful I suppose.
I'll also would like documentation on this. At least as a noob in ruby on rails, I would appreciate if even someone could direct me to where "settings" and "mappings" are defined so I can at least go look at how its implemented in the code
Still confused by this, could @picandocodigo help, please?