From 86bea9e0016b2890db8ba83049dd4e89653a0a5e Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 16 Mar 2012 17:29:39 -0400
Subject: [PATCH] Ensure that the welcome message is interpreted as UTF-8 (issue 74)

---
 src/com/gitblit/models/SearchResult.java |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/com/gitblit/models/SearchResult.java b/src/com/gitblit/models/SearchResult.java
index 44207f0..5662307 100644
--- a/src/com/gitblit/models/SearchResult.java
+++ b/src/com/gitblit/models/SearchResult.java
@@ -4,7 +4,7 @@
 import java.util.Date;
 import java.util.List;
 
-import com.gitblit.utils.LuceneUtils.ObjectType;
+import com.gitblit.Constants.SearchObjectType;
 
 /**
  * Model class that represents a search result.
@@ -25,18 +25,42 @@
 	public String committer;
 
 	public String summary;
+	
+	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;
+	
 	public List<String> labels;
 
-	public ObjectType type;
+	public SearchObjectType type;
 
 	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 type.name() + ": " + id;
+		return  score + " : " + type.name() + " : " + repository + " : " + getId() + " (" + branch + ")";
 	}
 }
\ No newline at end of file

--
Gitblit v1.9.1