jaibeermalik / elasticsearch-tutorial

ElasticSearch Java API tutorial using test cases.
MIT License
112 stars 83 forks source link

A problem with the new versions of elasticsearch #1

Open mariotti opened 9 years ago

mariotti commented 9 years ago

Apparently the setFields() and subsequent usage is not compatible with the new versions of elastic search.

This is not really well documented also on elasticsearch side.

The problem within this code rise up searching for "categories" which is not a main field, not sure about being a sub-field as it is defined within facets.

One of the issues is here: https://github.com/elasticsearch/elasticsearch/issues/4888

I had also some other problems with a new version of elasticsearch so right now I cannot give you more details (my code changed:( ), but if you have interest we can exchange a couple of messages and I can try to reproduce the problems. Also because I am not 100% sure where the problem is: if the java API or the elasticsearch server version. So I might need some hint on your side.

Indeed, if I can add here (not sure about githug, if I can send messages), I know it is a tutorial, but one thing I did was to include the full tutorial and tests as a test environment for my setup.

Which was useful to define the servers, nodes and the like. SO my idea would be to extend this tutorial to be a nice test suite. This requires a bit of work indeed.. but I would be interested.

Sorry, current versions! from pom.xml

1.3.2 4.9.0 The current ES installed is: elasticsearch.noarch 1.3.6-1 @elasticsearch-1.3
mariotti commented 9 years ago

Seem that the wiki is not set up. So I write a further comment here.

I was thinking to make this tutorial a test suite for applications. The main reason is that I learned a lot about configuring the local cluster and actually testing it and testing my network configuration.

So in my application, I would like to have this tutorial as a test suite for the servers, network, ES configuration, and java libraries, while I keep the application code and tests separated. This is indeed what I currently set up.

There is a problem in the design if I want to achieve this fully. There is some data and configuration dependency which I cannot easily split.

For example: SetupIndexServiceImpl and SetupIndexService seems to be data independent, but they import: ElasticSearchIndexConfig which is an enum type. This makes SetupIndexService totally dependent on specific data. I cannot easily change the enum type. In particular what I wanted to achieve was to use some index and data for main tests and an other index and data for other tests or even production.

As there is not much about java and ES, leave apart the ES documentation which is totally useless if you need a different approach from curl.

Can we make it the java reference?

cheers F

PS: If I can give a suggestion I would remove completely the class: ElasticSearchReservedWords.java Because it is somewhat redundant and it might lead to confusion. Even assuming changes within ES version, we would need to deal with them "explicitly" somewhere. I would prefer in code version dependencies as in the long run there is the risk to have a java concept vs an ES concept, which we do not want as the engine at the end is ES.