How to use mapper attachment plugin with JAVA API in elasticsearch - java

I had executed basic program of indexing and searching with JAVA API in elasticsearch.
Now I want to index the doc, pdf, pptx file for that purpose I need to include Mapper Attachment plugin. For using mapper Attachment plugin with JAVA API I am looking for tutorial or sample program.
Thank you for contribution.

Basically, just add mapper jar to your classpath and when you will start a node, it will be picked up.
Have a look at what we did in scrutmydocs project. It's somehow what you are trying to do.

Related

How to convert swagger JSON objects into Java class objects

Sorry for my naive question, I am looking for some tools that would automatically convert JSON objects (that are generated in swagger UI) to a Java class objects in Eclipse.
Are there any such tools or plugins that can integrate swagger code with Eclipse Java and Groovy Grails framework. It would save a lot of time by not rewriting a huge amount of Java code every time when I want to change something in JSON objects.
I suggest to use autorest tool to generate code and models. It supports multiple languages including Java. Here is the github repository autorest
Just follow simple steps-
npm install -g autorest
autorest --input-file=https://******url******/swagger/v1/swagger.json --java --namespace=****namespace*****
You can use Google Gson Library in java.
You could use that or Groovys JSONsluprer but I depending on what you're trying to achieve it might just be easiest if you have a swagger to start with swagger codegen https://github.com/swagger-api/swagger-codegen tools and have it make those for you. If not you can always look to investigate how they did it.

How to create open api documentation in .yaml format with maven?

I am building a rest api and part of the requirement is that we write documentation according to the open api specification. I am using (http://editor.swagger.io) to do this, and I find it irritating, and way less affective than creating normal javadoc. Is there a maven plugin, or something that can build documentation from comments in .yaml or .json format according to the open api specification? Thanks!
Seems like you're looking for that maven library https://springfox.github.io/springfox/docs/current/
It can automatically generate specifications in html

Extract JSON-LD from HTML using Apache Any23

My aim is to extract structured data from webpages. I'm using the code mentioned in this SO question. I'm using Apache Any23 CLI library dependency in my Spring project.
By using this, I'm able to extract the HTML5 Microdata (Schema.org) from webpages. But, I can't extract the JSON-LD format present in the webpages. When I checked Apache Any23's documentation, JSON-LD format is supported in it. Didn't find any further documentations on it.
Usually, if you create a new Any23 extractor with new Any23() it should work out of the box. If you use another constructor like Any23(String... extractorNames) you have to make make sure that the correct one is added for embedded JSON LD, which is "html-embedded-jsonld".
Now if there are any errors in the extraction process, Any23 drops them silently. (It's great, I know!)
I found it is possible to set a breakpoint in the org.apache.any23.extractorExtractionResultImpl method notifyIssue. With this you may be able to find a more detailed reason for your problems.

Running Rapidminer in Java

I'm new with rapidminer and played around a little with the Rapidminer Studio. However, now i'm trying to integrate my classifiers into a Java programm.
I want get soma data from a database, modify it to fit my purposes and classify it with the rapidminer process.
So here is the question:
How do I classify data with rapidminer-models directly from my java program and where to get the needed libraries??
Thank you for any help
I somehow googled the wrong thing for two days.
Found a solution now.
You can train your Model in Rapidminer, then use the following extention to export it as a .pmml.
https://marketplace.rapidminer.com/UpdateServer/faces/product_details.xhtml?productId=rmx_pmml
just add the extention via marketplace and use the "Write PMML"-Operator to create a pmml file of your model.
The pmml file can be included into your java programm with the following library:
https://github.com/jpmml/jpmml-evaluator
The link above explains pretty well how to use the library.

How to add external tags file into CEDET in Emacs

I tried to use CEDET to get auto completion in Emacs and that works fine for C/C++. But I cannot find anything about how to use CEDET with Java without the help of JDEE, which is thought out of date and not compatible to CEDET 1.1. I got a tags file using utility found here but I don't know how to integrate that into CEDET system. According to CEDET's website, that's possible. But they don't explain how to do it. Is there someone willing to answer this question?
Here is some sample of the tags file generated by that utility:
java.applet.Applet$AccessibleApplet
protected java.applet.Applet$AccessibleApplet(java.applet.Applet)
public java.applet.Applet$AccessibleApplet.getAccessibleRole() returns javax.accessibility.AccessibleRole
public java.applet.Applet$AccessibleApplet.getAccessibleStateSet() returns javax.accessibility.AccessibleStateSet
It is possible to have CEDET pull in tags from a .jar file. It works by using javap to extract the tags in text form, and then it parses that data.
It isn't very easy to set up since in CEDET, the concept of where to find your library files is part of EDE, the project management system, not the parser and smart completion system. The only Java based project supported in CEDET 1.1 is Android.
The basics is to first enable the javap database by loading it with (require 'semanticdb-javap) in CEDET 1.1, or (require 'semantic/db-javap) in the bzr version of CEDET.
Once you've done that, you can configure it via the cedet-java-classpath-extension. I'm a little fuzzy on the details of what happens next, but folks have reported success on the mailing list.
If you use CEDET from the bzr repository, there is the ede-java-root project, which is similar to the ede-cpp-root project. That project type lets you configure what your library path is. The doc for that is in the ede/java-root.el file with the project type, and shows you the basics of how to use it.

Categories