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

Commit

Permalink
Increase project search result per page
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Dec 19, 2013
1 parent e698099 commit c04c5d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions zanata-war/src/main/java/org/zanata/action/ProjectSearch.java
Expand Up @@ -27,6 +27,8 @@ public class ProjectSearch implements Serializable {

private static final long serialVersionUID = 1L;

private final static int DEFAULT_PAGE_SIZE = 30;

@Getter
@Setter
private int scrollerPage = 1;
Expand All @@ -47,7 +49,7 @@ public class ProjectSearch implements Serializable {
private ZanataIdentity identity;

private QueryProjectPagedListDataModel queryProjectPagedListDataModel =
new QueryProjectPagedListDataModel();
new QueryProjectPagedListDataModel(DEFAULT_PAGE_SIZE);

// Count of result to be return as part of autocomplete
private final static int INITIAL_RESULT_COUNT = 5;
Expand All @@ -64,9 +66,8 @@ public List<SearchResult> suggestProjects() {
List<HProject> searchResult =
projectDAO
.searchProjects(suggestQuery, INITIAL_RESULT_COUNT,
0,
identity.hasPermission("HProject",
"view-obsolete"));
0, identity.hasPermission("HProject",
"view-obsolete"));

for (HProject project : searchResult) {
result.add(new SearchResult(project));
Expand Down
Expand Up @@ -21,9 +21,6 @@
*/
package org.zanata.action;

import java.io.Serializable;
import java.util.List;

import lombok.Getter;
import lombok.Setter;
import org.apache.lucene.queryParser.ParseException;
Expand All @@ -32,6 +29,9 @@
import org.zanata.dao.ProjectDAO;
import org.zanata.model.HProject;

import java.io.Serializable;
import java.util.List;

public class QueryProjectPagedListDataModel extends
PagedListDataModel<HProject> implements Serializable {
private static final long serialVersionUID = 1L;
Expand All @@ -43,8 +43,8 @@ public class QueryProjectPagedListDataModel extends
@Getter
private String query;

public QueryProjectPagedListDataModel() {
setPageSize(2);
public QueryProjectPagedListDataModel(int pageSize) {
setPageSize(pageSize);
}

@Override
Expand Down

0 comments on commit c04c5d4

Please sign in to comment.