You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to ElasticSearch so I don't know if my question is relevant.
Given the following mappings, is it possible to index an attribute in a nested field only if a condition is matched..?
settings do
mappings dynamic: 'false' do
indexes :id, type: :keyword
indexes :areas, type: 'nested' do
indexes :id, type: :keyword
indexes :area_type, type: :keyword
indexes :zone, type: :geo_shape // => NEED A CONDITION HERE : index zone geo_shape only if the area has a specific area_type
end
end
end
My zone method for the geo_shape definition, in Area model looks like this :
def zone
{ type: 'polygon',
coordinates: [get_coordinates] }
end
but my problem is that all areas do NOT need a geo_shape indexing. I want to index geo_shape only for area with a specific area_type.
If indexing is absolutely necessary for all attributes, I was thinking of indexing an empty geo_shape instead of a polygon (but I don't manage to do this).
Your help would be much appreciated on this point,
The text was updated successfully, but these errors were encountered:
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.
I'm new to ElasticSearch so I don't know if my question is relevant.
Given the following
mappings
, is it possible to index an attribute in a nested field only if a condition is matched..?My
zone
method for the geo_shape definition, inArea
model looks like this :but my problem is that all areas do NOT need a geo_shape indexing. I want to index geo_shape only for area with a specific
area_type
.If indexing is absolutely necessary for all attributes, I was thinking of indexing an empty geo_shape instead of a polygon (but I don't manage to do this).
Your help would be much appreciated on this point,
The text was updated successfully, but these errors were encountered: