I can see that indexing is using an object storage strategy
// Ingest some data
AppData appData = new AppData();
appData.setIntValue(1337);
appData.setMsg("foo");
String docId = client.index(b -> b
.index(index)
.id("my/Id") // test with url-unsafe string
.document(appData)
.refresh(Refresh.True) // Make it visible for search
).id();
The process seems to be the following:
Create a class with properties only
Fill up an instance of this class
Send it to indexer which will identify your columns names from the getters and setters
My concern is that this object storage strategy looks very hard coded
You seem to have to declare and compile a class for every index structure.
In HLRC you had to fill up a XContentBuilder and send it. It relied on the mapping to recognize the field names dynamically. No programming adherence. One program fitted all.
Please tell me that this agnostic mode still exists in the new Java API ?
Raw JSON data is just another kind of object, so you can use Jackson's ObjectNode or the built-in mapper independent JsonData class. Anything that the JSON mapper is able to handle.
Thanks for the feedback, we'll expand the docs on this topic to avoid this kind of confusion.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.