EhCache Exception - ehcache

I am getting the below exception while using searchable with net.sf.ehcache:ehcache:2.9.0
net.sf.ehcache.config.InvalidConfigurationException: Search attributes
not supported by this store type: net.sf.ehcache.store.disk.DiskStore
Can Somebody help!

Related

Elasticsearch throwing an error during startup

I have implemented Elasticsearch in spring boot. On every server restart, I am getting the following error.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productController': Unsatisfied dependency expressed through field 'ps'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productServiceImpl': Unsatisfied dependency expressed through field 'pr'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Rejecting mapping update to [products] as the final mapping would have more than 1 type: [_doc, product]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.2.0.RELEASE.jar:5.2.0.RELEASE]
I have deleted the index every time to start the server and then perform the index. Can anyone suggest to me what will the solution
Elasticsearch v6 and above cannot have more than one type per index. But from your exception, your mapping is trying to create more than one type on an index (_doc and product)
Refer https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html for more info.
As mentioned #Karthick from Elasticsearch 6.X more than one type per index is deprecated and only _doc internal and default mapping type is supported till version 7(for backward compatibility purpose) and that too will be completely removed from soon to be released 8.X major version.
You need to remove your own type name product to solve the issue.
As mentioned in the official link why it's removed.
In an Elasticsearch index, fields that have the same name in different
mapping types are backed by the same Lucene field internally. In other
words, using the example above, the user_name field in the user type
is stored in exactly the same field as the user_name field in the
tweet type, and both user_name fields must have the same mapping
(definition) in both types.
This can lead to frustration when, for example, you want deleted to be
a date field in one type and a boolean field in another type in the
same index.
On top of that, storing different entities that have few or no fields
in common in the same index leads to sparse data and interferes with
Lucene’s ability to compress documents efficiently.
For these reasons, we have decided to remove the concept of mapping
types from Elasticsearch.

final mapping would have more than 1 type error after upgrade

After upgrading to 6.7.2 from 6.0.0 we are seeing mapping type error where it is trying to parse 2 types
we do have a type field in our events but looking at the release notes logstash 6.1 stops the type in the event to determine the _type field
The error we see is Rejecting mapping update to [logstash-2019.05.11] as the final mapping would have more than 1 type: [log4net, doc]"
I am hoping to remove the Log4net type and use the default doc type
Any help is appreciated

Elasticsearch, mapping type string cannot contain enabled false why?

The enabled :false mapping in Elastic-Search mapping for data-types String and nested gives an error can you tell me what would be the reason for this?
Can you please provide the mapping of your schema. Please use _mapping api of elastic-search to get it. Below is the example how you can hit it.
http://localhost:9200/jaipur/_mapping In this example jaipur is the index name.
Also please tell me the ES version you are using.
Latest ES version supports boolean data type. refer https://www.elastic.co/guide/en/elasticsearch/reference/current/boolean.html for more information.
The enabled setting, which can be applied only to the mapping type and to object fields.
https://www.elastic.co/guide/en/elasticsearch/reference/2.1/enabled.html

Spring Redis Data gives UncategorizedKeyValueException: nested exception is java.lang.NullPointerException

I'm using redis as my secondary db in my spring application and i need to get all records that have null values for certain attributes. I create query in repository to achieve that.
method
findAllByCars(Integer c);
it works when using with integer as the param but when i use it to find all records that Cars is null.
repo.findAllByCars(null)
it's gives below error in stack trace.
rg.springframework.data.keyvalue.core.UncategorizedKeyValueException: nested exception is java.lang.NullPointerException
at org.springframework.data.keyvalue.core.KeyValuePersistenceExceptionTranslator.translateExceptionIfPossible(KeyValuePersistenceExceptionTranslator.java:49)
at org.springframework.data.keyvalue.core.KeyValueTemplate.resolveExceptionIfPossible(KeyValueTemplate.java:484)
at org.springframework.data.keyvalue.core.KeyValueTemplate.execute(KeyValueTemplate.java:379)
at org.springframework.data.keyvalue.core.KeyValueTemplate.find(KeyValueTemplate.java:390)
Anyone can help this with?.

ElasticSearch Create Index, index already exists exception

I am trying a simple new index on elasticsearch cloud with postman (elastic v.52)
But i cant see this index in my control panel.
I also received an "index not found" exception when I tried to send a delete request to the server.
I do not know what I'm doing wrong. Any ideas ?
Create index request:
Delete request:
I found the problem. It's index name uppercase problem. But elastic result don't explation this on exception details.
My wrong old index name "i_serdarTest"
New accepted index name "i_serdartest"

Resources