From 98b4edf75ffe0fd57caece27701250e42c901ff3 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 12 Mar 2012 22:57:13 -0400
Subject: [PATCH] Revise indexed fields and improve Lucene page usability

---
 src/com/gitblit/models/SearchResult.java |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/com/gitblit/models/SearchResult.java b/src/com/gitblit/models/SearchResult.java
index c74229a..181eb0e 100644
--- a/src/com/gitblit/models/SearchResult.java
+++ b/src/com/gitblit/models/SearchResult.java
@@ -26,13 +26,17 @@
 
 	public String summary;
 	
-	public String content;
+	public String fragment;
 	
 	public String repository;
 	
 	public String branch;
 
-	public String id;
+	public String commitId;
+	
+	public String path;
+	
+	public String issueId;
 
 	public List<String> tags;
 	
@@ -42,9 +46,21 @@
 
 	public SearchResult() {
 	}
+	
+	public String getId() {
+		switch (type) {
+		case blob:
+			return path;
+		case commit:
+			return commitId;
+		case issue:
+			return issueId;
+		}
+		return commitId;
+	}
 
 	@Override
 	public String toString() {
-		return  score + " : " + type.name() + " : " + repository + " : " + id + " (" + branch + ")";
+		return  score + " : " + type.name() + " : " + repository + " : " + getId() + " (" + branch + ")";
 	}
 }
\ No newline at end of file

--
Gitblit v1.9.1