Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
send sort_order as json
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Jun 11, 2011
1 parent 0feac67 commit cd29c07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static Sort toSort(final String sort) throws ParseException {
}
}

public static String toString(final SortField[] sortFields) throws JSONException {
public static JSONArray toJSON(final SortField[] sortFields) throws JSONException {
final JSONArray result = new JSONArray();
for (final SortField field : sortFields) {
final JSONObject col = new JSONObject();
Expand Down Expand Up @@ -116,7 +116,7 @@ public static String toString(final SortField[] sortFields) throws JSONException
col.put("type", type);
result.put(col);
}
return result.toString();
return result;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public void search(final HttpServletRequest req,
// Include sort info (if requested).
if (td instanceof TopFieldDocs) {
queryRow.put("sort_order", CustomQueryParser
.toString(((TopFieldDocs) td).fields));
.toJSON(((TopFieldDocs) td).fields));
}
queryRow.put("rows", rows);
}
Expand Down

0 comments on commit cd29c07

Please sign in to comment.