Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an OpenGrok API? [closed]

Is there an API for OpenGrok? I'm interested in mining the results in either Perl or Java. At the moment, I could perform HTML scrapping against the results, but seems less-than-ideal.

As per its website, it leverages Lucene, but no real info on how to connect to it other than via HTML.

like image 591
Jose Leon Avatar asked Oct 17 '12 04:10

Jose Leon


3 Answers

Starting in OpenGrok 0.13, there is a simple REST API.

With OpenGrok 1.0 there is a JSON API.

like image 55
eh1160 Avatar answered Oct 15 '22 16:10

eh1160


Opengrok supports a command line interface that may be able to provide what you're looking for.

Example:

$ java -cp ./opengrok.jar org.opensolaris.opengrok.search.Search -R /var/opengrok/etc/configuration.xml -f "My Search"
like image 30
arcdegree Avatar answered Oct 15 '22 18:10

arcdegree


This fork has a JSON API: https://github.com/Goyaka/OpenGrok/blob/f70d78e743a0a389b46ea36c4785182ee8f03e13/src/com/goyaka/opengrok/web/SearchServlet.java

This issue discusses it: https://github.com/OpenGrok/OpenGrok/issues/422

like image 1
Philippe Ombredanne Avatar answered Oct 15 '22 17:10

Philippe Ombredanne