arafalov / git-to-solr

Index git history into a Solr repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-to-solr

Index git history into a Solr repository. Represents commit's content (file changed, etc) as nested documents. Tested against Solr 4.9 .

Inspired by Gary Sieling's solr-git and JGit-Cookbook.

Start Solr server by running java -Dsolr.solr.home=<project-root>/solr -jar start.jar from Solr distribution's example directory.

bin/solr create_core -c git -d ~/Projects/git-to-solr/solr/collection1/

To build the jar, you need to use Apache Maven and run mvn clean compile assembly:single at the top of the directory (where pom.xml is)

Query examples: http://localhost:8983/solr/git/select?q={!parent+which%3D%22type%3Acommit%22}diffType%3AADD&wt=json&indent=true&fl=*,[child%20parentFilter=type:commit] (decoded) http://localhost:8983/solr/git/select?q={!parent which="type:commit"}diffType:ADD&wt=json&indent=true&fl=*,[child parentFilter=type:commit]

Show commit (parents) that have ADD operations in them, include all nested children (whether they are ADD or MODIFY or whatever).

?Possible

  • Average number of different operations (ADD/MODIFY) per commit

About

Index git history into a Solr repository

License:Apache License 2.0


Languages

Language:Java 81.9%Language:JavaScript 10.2%Language:HTML 8.0%