Elastic search mapping issue with tire - ruby-on-rails

Following is the mapping in Occurrence model
mapping do
indexes :_event_id, type: 'integer', index: :not_analyzed,boost: 1000
indexes :start, type: 'date', index: :not_analyzed , boost: 100
indexes :events do
indexes :price, type: 'integer',boost: 100
indexes :title, boost: 700
indexes :description, boost: 200
indexes :acts do
indexes :name ,boost: 800
end
indexes :venue do
indexes :name ,boost: 500
end
indexes :tags do
indexes :name, boost: 1000
end
end
end
when I try to run rake environment tire:import CLASS=Occurrence FORCE=true
initially it generated mapping as below
{
"occurrences": {
"occurrence": {
"properties": {
"_event_id": {
"type": "integer",
"boost": 1000.0,
"omit_norms": false
},
"events": {
"properties": {
"acts": {
"properties": {
"name": {
"type": "string",
"boost": 800.0
}
}
},
"description": {
"type": "string",
"boost": 200.0
},
"price": {
"type": "integer",
"boost": 100.0,
"omit_norms": false
},
"tags": {
"properties": {
"name": {
"type": "string",
"boost": 1000.0
}
}
},
"title": {
"type": "string",
"boost": 700.0
},
"venue": {
"properties": {
"name": {
"type": "string",
"boost": 500.0
}
}
}
}
},
"start": {
"type": "date",
"boost": 100.0,
"omit_norms": false,
"format": "dateOptionalTime"
}
}
}
}
}
But after process started ,the above mapping is changed as below
{
"occurrences": {
"occurrence": {
"properties": {
"_event_id": {
"type": "integer",
"boost": 1000.0,
"omit_norms": false
},
"acts": {
"properties": {
"name": {
"type": "string"
}
}
},
"created_at": {
"type": "date",
"format": "dateOptionalTime"
},
"day_of_week": {
"type": "long"
},
"deleted": {
"type": "boolean"
},
"end": {
"type": "date",
"format": "dateOptionalTime"
},
"event_id": {
"type": "long"
},
"events": {
"properties": {
"acts": {
"properties": {
"name": {
"type": "string",
"boost": 800.0
}
}
},
"description": {
"type": "string",
"boost": 200.0
},
"price": {
"type": "integer",
"boost": 100.0,
"omit_norms": false
},
"tags": {
"properties": {
"name": {
"type": "string",
"boost": 1000.0
}
}
},
"title": {
"type": "string",
"boost": 700.0
},
"venue": {
"properties": {
"name": {
"type": "string",
"boost": 500.0
}
}
}
}
},
"id": {
"type": "long"
},
"recurrence_id": {
"type": "long"
},
"slug": {
"type": "string"
},
"start": {
"type": "date",
"boost": 100.0,
"omit_norms": false,
"format": "dateOptionalTime"
},
"tags": {
"properties": {
"name": {
"type": "string"
}
}
},
"updated_at": {
"type": "date",
"format": "dateOptionalTime"
},
"venue": {
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
}
}
}
Venue is coming two times with additional fields.
Can anyone please help me, why the mapping is getting change?
Thanks

Related

OpenAPI v3, how to hide objects in "Schemas" section

I'm using OpenAPI v3 to create my API docs and having them hosted on app.swaggerhub.com
Is there a way to hide an item from showing up in the Schemas section at the bottom? The real API has dozens of Schema objects, so it'd be very helpful to hide some of them.
Example:
Running this on https://editor-next.swagger.io/
{
"openapi": "3.0.3",
"info": {
"title": "Swagger Petstore - OpenAPI 3.0",
"description": "example",
"version": "1.0.11"
},
"servers": [
{
"url": "https://petstore3.swagger.io/api/v3"
}
],
"paths": {
"/pet": {
"post": {
"summary": "Add a new pet to the store",
"description": "Add a new pet to the store",
"operationId": "addPet",
"requestBody": {
"description": "Create a new pet in the store",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 10
},
"petId": {
"type": "integer",
"format": "int64",
"example": 198772
},
"quantity": {
"type": "integer",
"format": "int32",
"example": 7
},
"shipDate": {
"type": "string",
"format": "date-time"
},
"status": {
"type": "string",
"description": "Order Status",
"example": "approved",
"enum": [
"placed",
"approved",
"delivered"
]
},
"complete": {
"type": "boolean"
}
},
"xml": {
"name": "order"
}
},
"Customer": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 100000
},
"username": {
"type": "string",
"example": "fehguy"
},
"address": {
"type": "array",
"xml": {
"name": "addresses",
"wrapped": true
},
"items": {
"$ref": "#/components/schemas/Address"
}
}
},
"xml": {
"name": "customer"
}
},
"Address": {
"type": "object",
"properties": {
"street": {
"type": "string",
"example": "437 Lytton"
},
"city": {
"type": "string",
"example": "Palo Alto"
},
"state": {
"type": "string",
"example": "CA"
},
"zip": {
"type": "string",
"example": "94301"
}
},
"xml": {
"name": "address"
}
},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"name": {
"type": "string",
"example": "Dogs"
}
},
"xml": {
"name": "category"
}
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 10
},
"username": {
"type": "string",
"example": "theUser"
},
"firstName": {
"type": "string",
"example": "John"
},
"lastName": {
"type": "string",
"example": "James"
},
"email": {
"type": "string",
"example": "john#email.com"
},
"password": {
"type": "string",
"example": "12345"
},
"phone": {
"type": "string",
"example": "12345"
},
"userStatus": {
"type": "integer",
"description": "User Status",
"format": "int32",
"example": 1
}
},
"xml": {
"name": "user"
}
},
"Tag": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"xml": {
"name": "tag"
}
},
"Pet": {
"required": [
"name",
"photoUrls"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 10
},
"name": {
"type": "string",
"example": "doggie"
},
"category": {
"$ref": "#/components/schemas/Category"
},
"photoUrls": {
"type": "array",
"xml": {
"wrapped": true
},
"items": {
"type": "string",
"xml": {
"name": "photoUrl"
}
}
},
"tags": {
"type": "array",
"xml": {
"wrapped": true
},
"items": {
"$ref": "#/components/schemas/Tag"
}
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
]
}
},
"xml": {
"name": "pet"
}
},
"ApiResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"type": {
"type": "string"
},
"message": {
"type": "string"
}
},
"xml": {
"name": "##default"
}
}
},
"requestBodies": {
"Pet": {
"description": "Pet object that needs to be added to the store",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
},
"UserArray": {
"description": "List of user object",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
},
"securitySchemes": {
"petstore_auth": {
"type": "oauth2",
"flows": {
"implicit": {
"authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
"scopes": {
"write:pets": "modify pets in your account",
"read:pets": "read your pets"
}
}
}
},
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
}
}
}
...this gets generated:
In this example, I'd like to hide a few of the schema items from view (like Customer or Address).
Note: I'm not self-hosting, so I'm hoping there's a tag I can put into the YAML or JSON.
Thanks,
Ryan

Complex Nested JSON Conversion to Data Table without creating class in C#

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Title",
"type": "object",
"properties": {
"location": {
"type": "string"
},
"dagno": {
"type": "string"
},
"pattano": {
"type": "string"
},
"pattatype": {
"type": "string"
},
"landclass": {
"type": "string"
},
"bigha": {
"type": "string"
},
"katha": {
"type": "string"
},
"lessa": {
"type": "string"
},
"pid": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"pdarid": {
"type": "string"
},
"pdarname": {
"type": "string"
},
"pdarfather": {
"type": "string"
}
},
"required": [
"pdarid",
"pdarname",
"pdarfather"
]
}
]
}
},
"required": [
"location",
"dagno",
"pattano",
"pattatype",
"landclass",
"bigha",
"katha",
"lessa",
"pid"
]
}

Springfox error "Unable to find a model that matches key" for {namespace='java.lang', name='Class�ConstraintValidator�object,object��'}

I'm getting these error messages in logs:
[12:15 11:48:20.957] [ERROR][request id: ffdedde3-f147-4fc2-9f9f-ad0c76c1a868][springfox.documentation.swagger2.mappers.ReferenceModelSpecificationToPropertyConverter] - Unable to find a model that matches key ModelKey{qualifiedModelName=ModelName{namespace='java.lang', name='Class�ConstraintValidator�object,object��'}, viewDiscriminator=com.test.entity.view.View$External, validationGroupDiscriminators=[], isResponse=true}
[12:15 11:48:20.957] [ERROR][request id: ffdedde3-f147-4fc2-9f9f-ad0c76c1a868][springfox.documentation.swagger2.mappers.ReferenceModelSpecificationToPropertyConverter] - Unable to find a model that matches key ModelKey{qualifiedModelName=ModelName{namespace='java.lang', name='Class�object�'}, viewDiscriminator=com.test.entity.view.View$External, validationGroupDiscriminators=[], isResponse=true}
[12:15 11:48:20.958] [ERROR][request id: ffdedde3-f147-4fc2-9f9f-ad0c76c1a868][springfox.documentation.swagger2.mappers.ReferenceModelSpecificationToPropertyConverter] - Unable to find a model that matches key ModelKey{qualifiedModelName=ModelName{namespace='java.lang', name='Class�Payload�'}, viewDiscriminator=com.test.entity.view.View$External, validationGroupDiscriminators=[], isResponse=true}
[12:15 11:48:20.991] [ERROR][request id: ffdedde3-f147-4fc2-9f9f-ad0c76c1a868][springfox.documentation.swagger2.mappers.ReferenceModelSpecificationToPropertyConverter] - Unable to find a model that matches key ModelKey{qualifiedModelName=ModelName{namespace='java.lang', name='Class�ConstraintValidator�object,object��'}, viewDiscriminator=null, validationGroupDiscriminators=[], isResponse=true}
[12:15 11:48:20.991] [ERROR][request id: ffdedde3-f147-4fc2-9f9f-ad0c76c1a868][springfox.documentation.swagger2.mappers.ReferenceModelSpecificationToPropertyConverter] - Unable to find a model that matches key ModelKey{qualifiedModelName=ModelName{namespace='java.lang', name='Class�object�'}, viewDiscriminator=null, validationGroupDiscriminators=[], isResponse=true}
[12:15 11:48:20.992] [ERROR][request id: ffdedde3-f147-4fc2-9f9f-ad0c76c1a868][springfox.documentation.swagger2.mappers.ReferenceModelSpecificationToPropertyConverter] - Unable to find a model that matches key ModelKey{qualifiedModelName=ModelName{namespace='java.lang', name='Class�Payload�'}, viewDiscriminator=null, validationGroupDiscriminators=[], isResponse=true}
It seems as custom validation annotations are somehow involved and related to them fields are treated as models or smth.
Example:
#Target({ElementType.TYPE})
#Retention(RetentionPolicy.RUNTIME)
#Constraint(validatedBy = CardDocumentValidator.class)
#Documented
public #interface CardDocument {
String message();
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
public class CardDocumentValidator implements ConstraintValidator<CardDocument, TestEntity> {...}
I'm using Spring Boot 2.5.5 with springfox-boot-starter 3.0.0.
However I'm still on OpenApi 2.0, so I have configured the property springfox:documentation:swagger:use-model-v3: false, which helped me to get rid of similar errors.
In api-docs json among definitions:
"ConstraintDescriptor«object»": {
"type": "object",
"properties": {
"annotation": {
"type": "object"
},
"attributes": {
"type": "object"
},
"composingConstraints": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/ConstraintDescriptor«object»"
}
},
"constraintValidatorClasses": {
"type": "array",
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«ConstraintValidator«object,object»»'}"
}
},
"groups": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«object»'}"
}
},
"messageTemplate": {
"type": "string"
},
"payload": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«Payload»'}"
}
},
"reportAsSingleViolation": {
"type": "boolean"
},
"validationAppliesTo": {
"type": "string",
"enum": [
"IMPLICIT",
"PARAMETERS",
"RETURN_VALUE"
]
},
"valueUnwrapping": {
"type": "string",
"enum": [
"DEFAULT",
"SKIP",
"UNWRAP"
]
}
},
"title": "ConstraintDescriptor«object»"
},
"ConstraintDescriptor«object»DefaultView": {
"type": "object",
"properties": {
"annotation": {
"type": "object"
},
"attributes": {
"type": "object"
},
"composingConstraints": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/ConstraintDescriptor«object»DefaultView"
}
},
"constraintValidatorClasses": {
"type": "array",
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«ConstraintValidator«object,object»»'}"
}
},
"groups": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«object»'}"
}
},
"messageTemplate": {
"type": "string"
},
"payload": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«Payload»'}"
}
},
"reportAsSingleViolation": {
"type": "boolean"
},
"validationAppliesTo": {
"type": "string",
"enum": [
"IMPLICIT",
"PARAMETERS",
"RETURN_VALUE"
]
},
"valueUnwrapping": {
"type": "string",
"enum": [
"DEFAULT",
"SKIP",
"UNWRAP"
]
}
},
"title": "ConstraintDescriptor«object»DefaultView"
},
"ConstraintDescriptor«object»ExternalView": {
"type": "object",
"properties": {
"annotation": {
"type": "object"
},
"attributes": {
"type": "object"
},
"composingConstraints": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/ConstraintDescriptor«object»ExternalView"
}
},
"constraintValidatorClasses": {
"type": "array",
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«ConstraintValidator«object,object»»'}"
}
},
"groups": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«object»'}"
}
},
"messageTemplate": {
"type": "string"
},
"payload": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/Error-ModelName{namespace='java.lang', name='Class«Payload»'}"
}
},
"reportAsSingleViolation": {
"type": "boolean"
},
"validationAppliesTo": {
"type": "string",
"enum": [
"IMPLICIT",
"PARAMETERS",
"RETURN_VALUE"
]
},
"valueUnwrapping": {
"type": "string",
"enum": [
"DEFAULT",
"SKIP",
"UNWRAP"
]
}
},
"title": "ConstraintDescriptor«object»ExternalView"
},
"ConstraintValidator«object,object»": {
"type": "object",
"title": "ConstraintValidator«object,object»"
},
"ConstraintValidator«object,object»DefaultView": {
"type": "object",
"title": "ConstraintValidator«object,object»DefaultView"
},
"ConstraintValidator«object,object»ExternalView": {
"type": "object",
"title": "ConstraintValidator«object,object»ExternalView"
},
"ConstraintViolation": {
"type": "object",
"properties": {
"constraintDescriptor": {
"$ref": "#/definitions/ConstraintDescriptor«object»"
},
"executableParameters": {
"type": "array",
"items": {
"type": "object"
}
},
"executableReturnValue": {
"type": "object"
},
"invalidValue": {
"type": "object"
},
"leafBean": {
"type": "object"
},
"message": {
"type": "string"
},
"messageTemplate": {
"type": "string"
},
"propertyPath": {
"$ref": "#/definitions/Path"
},
"rootBean": {
"type": "object"
}
},
"title": "ConstraintViolation"
},
"ConstraintViolationDefaultView": {
"type": "object",
"properties": {
"constraintDescriptor": {
"$ref": "#/definitions/ConstraintDescriptor«object»DefaultView"
},
"executableParameters": {
"type": "array",
"items": {
"type": "object"
}
},
"executableReturnValue": {
"type": "object"
},
"invalidValue": {
"type": "object"
},
"leafBean": {
"type": "object"
},
"message": {
"type": "string"
},
"messageTemplate": {
"type": "string"
},
"propertyPath": {
"$ref": "#/definitions/PathDefaultView"
},
"rootBean": {
"type": "object"
}
},
"title": "ConstraintViolationDefaultView"
},
"ConstraintViolationExternalView": {
"type": "object",
"properties": {
"constraintDescriptor": {
"$ref": "#/definitions/ConstraintDescriptor«object»ExternalView"
},
"executableParameters": {
"type": "array",
"items": {
"type": "object"
}
},
"executableReturnValue": {
"type": "object"
},
"invalidValue": {
"type": "object"
},
"leafBean": {
"type": "object"
},
"message": {
"type": "string"
},
"messageTemplate": {
"type": "string"
},
"propertyPath": {
"$ref": "#/definitions/PathExternalView"
},
"rootBean": {
"type": "object"
}
},
"title": "ConstraintViolationExternalView"
},
Found the culprit :)
private Set validationErrors in one of the base entity classes.
So ConstraintViolation was added to Models and ConstraintDescriptor and its fields' classes which included:
private final List<Class<? extends ConstraintValidator<T, ?>>> constraintValidatorClasses;
private final Set<Class<?>> groups;
private final Set<Class<? extends Payload>> payloads;
Putting #JsonIgnore helped. Another way is to add #ApiModelProperty(hidden = true) which doesn't affect serialization by simply hiding the field from being documented.

How to read geojson with vega

It sounds super simple, but I can't get how can I use geojson, not topojson, for my polygons.
that's my current attempt:
"data": [
{
"name": "nabs",
"url": "both_boundaries.geojson",
"format": {"type": "json"},
"transform": [
{
"type": "geopath", "projection": "mercator",
"scale": 74, "center": [-73.99,40.72]
}
]
}
]
You have to parse the features using property within your format:
"format": {"type": "json", "property":"features"},
Full example spec:
{"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"width": 500,
"height": 600,
"autosize": "none",
"signals": [
{
"name": "translate0",
"update": "width / 2"
},
{
"name": "translate1",
"update": "height / 2"
}
],
"projections": [
{
"name": "projection",
"size": {"signal": "[width, height]"},
"fit": {"signal": "data('netherlands')"}
}
],
"data": [
{
"name": "netherlands",
"url": "https://raw.githubusercontent.com/mattijn/datasets/master/NL_outline_geo.json",
"format": {
"type": "json",
"property": "features"
}
}
],
"marks": [
{
"type": "shape",
"from": {
"data": "netherlands"
},
"encode": {
"update": {
"strokeWidth": {
"value": 0.5
},
"stroke": {
"value": "darkblue"
},
"fill": {
"value": "lightblue"
},
"fillOpacity": {
"value": 0.5
}
},
"hover": {
"fill": {
"value": "#66C2A5"
},
"strokeWidth": {
"value": 2
},
"stroke": {
"value": "#FC8D62"
}
}
},
"transform": [
{
"type": "geoshape",
"projection": "projection"
}
]
}
]
}

My ES custom analyser is not used?

I'm using Elasticsearch and create an index with the following information for mapping and settings. The problem I have is that my field geography.locality which should use the 'name_analyser' doesn't seem to use it.
{
"index": "programs",
"body": {
"settings": {
"number_of_shards": 5,
"analysis": {
"filter": {
"elision": {
"type": "elision",
"articles": [
"l",
"m",
"t",
"qu",
"n",
"s",
"j",
"d"
]
},
"multi_words": {
"type": "shingle",
"min_shingle_size": 2,
"max_shingle_size": 10
},
"name_filter": {
"type": "edgeNGram",
"max_gram": 100,
"min_gram": 2
}
},
"tokenizer": {
"name_tokenizer": {
"type": "edgeNGram",
"max_gram": 100,
"min_gram": 2
}
},
"analyser": {
"name_analyser": { // <-- analyser I want to use on geography.locality
"tokenizer": "whitespace",
"type": "custom",
"filter": [
"lowercase",
"multi_words",
"name_filter",
"asciifolding"
]
},
"french": {
"tokenizer": "letter",
"filter": [
"asciifolding",
"lowercase",
"elision",
"stop"
]
},
"city_name": {
"type": "custom",
"tokenizer": "letter",
"filter": [
"lowercase",
"asciifolding"
]
}
}
}
},
"mappings": {
"program": {
"properties": {
"nid": {
"type": "integer",
"index": "not_analyzed"
},
"title": {
"type": "string"
},
"language": {
"type": "string",
"index": "not_analyzed"
},
"regulation": {
"type": "integer"
},
"sales_state": {
"type": "integer"
},
"enabled_dwell": {
"type": "boolean"
},
"enabled_invest": {
"type": "boolean"
},
"delivery_date": {
"type": "date"
},
"address": {
"properties": {
"country": {
"type": "string",
"index": "not_analyzed"
},
"locality": {
"type": "string",
"analyser": "name_analyser"
},
"postal_code": {
"type": "integer"
},
"thoroughfare": {
"type": "string",
"index": "not_analyzed"
},
"premise": {
"type": "string",
"index": "not_analyzed"
}
}
},
"location": {
"type": "geo_point"
},
"geography": {
"properties": {
"locality": {
"type": "string",
"analyser": "name_analyser" // ... here :-/
},
"department": {
"type": "string",
"index": "not_analyzed"
},
"region": {
"type": "string",
"index": "not_analyzed"
}
}
},
"lots": {
"type": "nested",
"include_in_all": false,
"properties": {
"lot_type": {
"type": "integer"
},
"rooms": {
"type": "integer"
},
"price_vat_inc": {
"type": "integer"
},
"price_reduced_vat_inc": {
"type": "integer"
},
"price_vat_ex": {
"type": "integer"
}
}
}
}
}
}
}
}
Here's the output given by ES for the mapping registered for this index.
{
"program": {
"properties": {
"address": {
"properties": {
"country": {
"index": "not_analyzed",
"type": "string"
},
"premise": {
"index": "not_analyzed",
"type": "string"
},
"locality": {
"type": "string"
},
"postal_code": {
"type": "integer"
},
"thoroughfare": {
"index": "not_analyzed",
"type": "string"
}
}
},
"sales_state": {
"type": "integer"
},
"nid": {
"type": "integer"
},
"language": {
"index": "not_analyzed",
"type": "string"
},
"title": {
"type": "string"
},
"enabled_invest": {
"type": "boolean"
},
"geo_point": {
"type": "string"
},
"lots": {
"include_in_all": false,
"type": "nested",
"properties": {
"rooms": {
"include_in_all": false,
"type": "integer"
},
"price_vat_inc": {
"include_in_all": false,
"type": "integer"
},
"price_vat_ex": {
"include_in_all": false,
"type": "integer"
},
"lot_type": {
"include_in_all": false,
"type": "integer"
},
"price_reduced_vat_inc": {
"include_in_all": false,
"type": "integer"
}
}
},
"enabled_dwell": {
"type": "boolean"
},
"delivery_date": {
"format": "dateOptionalTime",
"type": "date"
},
"regulation": {
"type": "integer"
},
"geography": {
"properties": {
"locality": {
"type": "string" // name_analyser should show up here right?????
},
"department": {
"index": "not_analyzed",
"type": "string"
},
"region": {
"index": "not_analyzed",
"type": "string"
}
}
},
"location": {
"type": "geo_point"
}
}
}
}
Does anybody knows what I am doing wrong? I'm kind of lost about this.
You have a typo :-), actually two:
"locality": {
"type": "string",
"analyser": "name_analyser"
},
in both address and geography. It should be analyzer not analyser (with an s).
Also, the same here:
"analyser": {
"name_analyser": {
"tokenizer": "whitespace",
...
I am guessing that the index exists and you are trying to update the settings with a new analyser. This is not permitted on a live index.
Do you have any errors when you submit the updated settings?
Have a look at this thread - Change settings and mappings on existing index in Elasticsearch
and here http://www.elastic.co/guide/en/elasticsearch/reference/1.x/indices-update-settings.html#update-settings-analysis

Resources