#615 use request query
This commit is contained in:
parent
a523b286c5
commit
c0fa65b521
5 changed files with 16 additions and 12 deletions
|
@ -145,9 +145,11 @@ public class Constants extends CoreLibConstants {
|
|||
|
||||
public static final String PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY = "purge.suggest.searchlog.day";
|
||||
|
||||
public static final String HIGHLIGHT_QUERIES = "org.codelibs.fess.Queries";
|
||||
public static final String REQUEST_QUERIES = "fess.Queries";
|
||||
|
||||
public static final String FIELD_LOGS = "org.codelibs.fess.FieldLogs";
|
||||
public static final String HIGHLIGHT_QUERIES = "fess.HighlightQueries";
|
||||
|
||||
public static final String FIELD_LOGS = "fess.FieldLogs";
|
||||
|
||||
public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
|
||||
|
||||
|
@ -267,15 +269,15 @@ public class Constants extends CoreLibConstants {
|
|||
|
||||
// view parameters
|
||||
|
||||
public static final String FACET_QUERY = "org.codelibs.fess.tag.FacetQuery";
|
||||
public static final String FACET_QUERY = "fess.FacetQuery";
|
||||
|
||||
public static final String GEO_QUERY = "org.codelibs.fess.tag.GeoQuery";
|
||||
public static final String GEO_QUERY = "fess.GeoQuery";
|
||||
|
||||
public static final String FACET_FORM = "org.codelibs.fess.tag.FacetForm";
|
||||
public static final String FACET_FORM = "fess.FacetForm";
|
||||
|
||||
public static final String GEO_FORM = "org.codelibs.fess.tag.GeoForm";
|
||||
public static final String GEO_FORM = "fess.GeoForm";
|
||||
|
||||
public static final String LABEL_VALUE_MAP = "org.codelibs.fess.LabelValueMap";
|
||||
public static final String LABEL_VALUE_MAP = "fess.LabelValueMap";
|
||||
|
||||
public static final String OPTION_QUERY_Q = "q";
|
||||
|
||||
|
|
|
@ -100,8 +100,9 @@ public class GsaApiManager extends BaseApiManager implements WebApiManager {
|
|||
try {
|
||||
final SearchRenderData data = new SearchRenderData();
|
||||
final GsaRequestParams params = new GsaRequestParams(request, fessConfig);
|
||||
searchService.search(params, data, OptionalThing.empty());
|
||||
query = params.getQuery();
|
||||
request.setAttribute(Constants.REQUEST_QUERIES, query);
|
||||
searchService.search(params, data, OptionalThing.empty());
|
||||
final String execTime = data.getExecTime();
|
||||
final long allRecordCount = data.getAllRecordCount();
|
||||
final List<Map<String, Object>> documentItems = data.getDocumentItems();
|
||||
|
|
|
@ -141,8 +141,9 @@ public class JsonApiManager extends BaseApiManager {
|
|||
try {
|
||||
final SearchRenderData data = new SearchRenderData();
|
||||
final JsonRequestParams params = new JsonRequestParams(request, fessConfig);
|
||||
searchService.search(params, data, OptionalThing.empty());
|
||||
query = params.getQuery();
|
||||
request.setAttribute(Constants.REQUEST_QUERIES, query);
|
||||
searchService.search(params, data, OptionalThing.empty());
|
||||
final String execTime = data.getExecTime();
|
||||
final String queryTime = Long.toString(data.getQueryTime());
|
||||
final String pageSize = Integer.toString(data.getPageSize());
|
||||
|
|
|
@ -122,6 +122,7 @@ public class SearchAction extends FessSearchAction {
|
|||
buildFormParams(form);
|
||||
form.lang = searchService.getLanguages(request, form);
|
||||
request.setAttribute(Constants.REQUEST_LANGUAGES, form.lang);
|
||||
request.setAttribute(Constants.REQUEST_QUERIES, form.q);
|
||||
final WebRenderData renderData = new WebRenderData();
|
||||
searchService.search(form, renderData, getUserBean());
|
||||
return asHtml(path_SearchJsp).renderWith(data -> {
|
||||
|
|
|
@ -322,12 +322,11 @@ public class ViewHelper {
|
|||
}
|
||||
|
||||
protected String appendPDFSearchWord(final String url) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Set<String> queries = (Set<String>) LaRequestUtil.getRequest().getAttribute(Constants.HIGHLIGHT_QUERIES);
|
||||
final String queries = (String) LaRequestUtil.getRequest().getAttribute(Constants.REQUEST_QUERIES);
|
||||
if (queries != null) {
|
||||
final StringBuilder buf = new StringBuilder(url.length() + 100);
|
||||
buf.append(url).append("#search=%22");
|
||||
buf.append(String.join(" ", queries.toArray(new String[queries.size()])));
|
||||
buf.append(queries); // TODO encode
|
||||
buf.append("%22");
|
||||
return buf.toString();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue