summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/tickets/TicketIndexer.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-10-21 11:43:43 -0600
committerJames Moger <james.moger@gitblit.com>2014-10-21 11:43:43 -0600
commite580f60256e6f18a326b95467c2bdbccad2126c6 (patch)
tree6e7a52a951cf3c97e9d27f7c37aabc5797095791 /src/main/java/com/gitblit/tickets/TicketIndexer.java
parent5be2d394c28f12269ba1aa8e2bd4f9cbd5db9540 (diff)
parentad80a949ae334a18d5757df729198801299011dc (diff)
downloadgitblit-e580f60256e6f18a326b95467c2bdbccad2126c6.tar.gz
gitblit-e580f60256e6f18a326b95467c2bdbccad2126c6.zip
Merged #157 "Add Priority & Severity fields to the ticket model"
Diffstat (limited to 'src/main/java/com/gitblit/tickets/TicketIndexer.java')
-rw-r--r--src/main/java/com/gitblit/tickets/TicketIndexer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/tickets/TicketIndexer.java b/src/main/java/com/gitblit/tickets/TicketIndexer.java
index 11ea3a73..e2d53af7 100644
--- a/src/main/java/com/gitblit/tickets/TicketIndexer.java
+++ b/src/main/java/com/gitblit/tickets/TicketIndexer.java
@@ -103,7 +103,10 @@ public class TicketIndexer {
mergesha(Type.STRING),
mergeto(Type.STRING),
patchsets(Type.INT),
- votes(Type.INT);
+ votes(Type.INT),
+ //NOTE: Indexing on the underlying value to allow flexibility on naming
+ priority(Type.INT),
+ severity(Type.INT);
final Type fieldType;
@@ -519,6 +522,8 @@ public class TicketIndexer {
toDocField(doc, Lucene.watchedby, StringUtils.flattenStrings(ticket.getWatchers(), ";").toLowerCase());
toDocField(doc, Lucene.mentions, StringUtils.flattenStrings(ticket.getMentions(), ";").toLowerCase());
toDocField(doc, Lucene.votes, ticket.getVoters().size());
+ toDocField(doc, Lucene.priority, ticket.priority.getValue());
+ toDocField(doc, Lucene.severity, ticket.severity.getValue());
List<String> attachments = new ArrayList<String>();
for (Attachment attachment : ticket.getAttachments()) {
@@ -600,6 +605,8 @@ public class TicketIndexer {
result.participants = unpackStrings(doc, Lucene.participants);
result.watchedby = unpackStrings(doc, Lucene.watchedby);
result.mentions = unpackStrings(doc, Lucene.mentions);
+ result.priority = TicketModel.Priority.fromObject(unpackInt(doc, Lucene.priority), TicketModel.Priority.defaultPriority);
+ result.severity = TicketModel.Severity.fromObject(unpackInt(doc, Lucene.severity), TicketModel.Severity.defaultSeverity);
if (!StringUtils.isEmpty(doc.get(Lucene.patchset.name()))) {
// unpack most recent patchset