Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz1060598 - Project search now discards obsolete projects from resu…
Browse files Browse the repository at this point in the history
…lts for non-admins.
  • Loading branch information
Carlos A. Munoz committed Feb 6, 2014
1 parent d5f089d commit eaa668e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions zanata-model/src/main/java/org/zanata/model/HProject.java
Expand Up @@ -148,6 +148,7 @@ public class HProject extends SlugEntityBase implements Serializable,

@Type(type = "entityStatus")
@NotNull
@Field
private EntityStatus status = EntityStatus.ACTIVE;

public void addIteration(HProjectIteration iteration) {
Expand Down
6 changes: 2 additions & 4 deletions zanata-war/src/main/java/org/zanata/dao/ProjectDAO.java
Expand Up @@ -235,10 +235,8 @@ public List<HProject> searchProjects(@Nonnull String searchQuery,
int maxResult, int firstResult, boolean includeObsolete)
throws ParseException {
FullTextQuery query = getTextQuery(searchQuery, includeObsolete);
query.setMaxResults(maxResult).setFirstResult(firstResult)
return query.setMaxResults(maxResult).setFirstResult(firstResult)
.getResultList();

return query.getResultList();
}

public int getQueryProjectSize(@Nonnull String searchQuery,
Expand All @@ -264,7 +262,7 @@ private FullTextQuery getTextQuery(@Nonnull String searchQuery,
if (!includeObsolete) {
TermQuery obsoleteStateQuery =
new TermQuery(new Term(IndexFieldLabels.ENTITY_STATUS,
EntityStatus.OBSOLETE.toString()));
EntityStatus.OBSOLETE.toString().toLowerCase()));
booleanQuery.add(obsoleteStateQuery, BooleanClause.Occur.MUST_NOT);
}

Expand Down

0 comments on commit eaa668e

Please sign in to comment.