Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live log preview 12.1.x #1637

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1173630
fix #1589 add query.additional.scroll.response.fields
marevol Apr 5, 2018
fa2d967
fix #1590 fix index.scroll.search.timeout
marevol Apr 5, 2018
1fa42e2
fix #1591 add maxConfigSyncStatusRetry
marevol Apr 5, 2018
355bbc2
fix #1592 add maxEsStatusRetry
marevol Apr 5, 2018
cd58528
fix #1595 add sdh
marevol Apr 6, 2018
906718a
update jsp files in orig
marevol Apr 6, 2018
ec2a7d9
fix #1602 add thumbnails diretory
marevol Apr 12, 2018
7d5c99b
fix #1603 add FESS_APP_TYPE
marevol Apr 12, 2018
68cac36
tech(SSL): SSL FESS <=> ELK
Apr 17, 2018
08e6f57
Merge pull request #1610 from PlaceMe-SAS/tech/ssl-between-fess-and-elk
marevol Apr 17, 2018
b1efb96
#1610 use fess-xpack
marevol Apr 17, 2018
eb42a76
elasticsearch 6.2.4
marevol Apr 18, 2018
aed8385
fix #1612 add index.auto_expand_replicas
marevol Apr 19, 2018
33e2fe8
fix #1613 change num of shards
marevol Apr 19, 2018
00ef9a9
fix #1614 add auto_expand_replicas
marevol Apr 19, 2018
f69fc4e
fix #1615 groovy and function support
marevol Apr 19, 2018
339ce38
fess crawler 2.1.2
marevol Apr 20, 2018
cbd1bf0
configsync 6.2.3
marevol Apr 20, 2018
db3157c
fix #1618 check if thumbnail is enabled
marevol Apr 20, 2018
2723c73
fix #1620 remove context path
marevol Apr 21, 2018
8a7df4f
suggest 6.2.2
marevol Apr 21, 2018
13c35d3
[maven-release-plugin] prepare release fess-12.1.2
marevol Apr 21, 2018
53e197b
[maven-release-plugin] prepare for next development iteration
marevol Apr 21, 2018
f1f37ca
fix #1623 add default preference
marevol Apr 24, 2018
f918a21
fix #1628 add score and view fields
marevol Apr 30, 2018
f7f98cc
fix #1628 add score and view fields
marevol Apr 30, 2018
76d9ba2
fix #1629 disable result collapsing in scroll request
marevol Apr 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<param name="plugin.groupId" value="org/codelibs" />
<param name="plugin.name.prefix" value="elasticsearch-" />
<param name="plugin.name" value="configsync" />
<param name="plugin.version" value="6.2.2" />
<param name="plugin.zip.version" value="6.2.2" />
<param name="plugin.version" value="6.2.3" />
<param name="plugin.zip.version" value="6.2.3" />
</antcall>
<!-- dataformat -->
<antcall target="install.plugin">
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.codelibs.fess</groupId>
<artifactId>fess</artifactId>
<version>12.1.2-SNAPSHOT</version>
<version>12.1.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>Fess</name>
<description>Fess is Full tExt Search System.</description>
Expand Down Expand Up @@ -60,13 +60,13 @@
<utflute.version>0.8.5</utflute.version>

<!-- Crawler -->
<crawler.version>2.1.1</crawler.version>
<crawler.version>2.1.2</crawler.version>

<!-- Suggest -->
<suggest.version>6.2.1</suggest.version>
<suggest.version>6.2.2</suggest.version>

<!-- Elasticsearch -->
<elasticsearch.version>6.2.3</elasticsearch.version>
<elasticsearch.version>6.2.4</elasticsearch.version>
<elasticsearch.min.version>6.0.0</elasticsearch.min.version>
<cluster.runner.version>${elasticsearch.version}.0</cluster.runner.version>

Expand Down
4 changes: 4 additions & 0 deletions src/main/assemblies/files/fess.in.bat
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.shutdownHookEnabled=false
set JAVA_OPTS=%JAVA_OPTS% -Dlog4j2.disable.jmx=true
set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.skipJansi=true

REM SSL truststore for certificate validation over https
REM JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore=/tech/elastic/config/truststore.jks
REM JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStorePassword=changeit

if NOT "%FESS_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails
if NOT "%FESS_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCTimeStamps
if NOT "%FESS_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDateStamps
Expand Down
4 changes: 4 additions & 0 deletions src/main/assemblies/files/fess.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ fi
#ES_TRANSPORT_URL=localhost:9300
#FESS_DICTIONARY_PATH=/var/lib/elasticsearch/config/

# SSL truststore for certificate validation over https
#JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStore=/tech/elastic/config/truststore.jks"
#JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStorePassword=changeit"

# min and max heap sizes should be set to the same value to avoid
# stop-the-world GC pauses during resize, and so that we can lock the
# heap in memory on startup to prevent any of it from being swapped
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/codelibs/fess/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class Constants extends CoreLibConstants {

public static final Boolean F = false;

public static final String SCORE = "score";

public static final String ON = "on";

public static final String READY = "ready";
Expand Down
52 changes: 25 additions & 27 deletions src/main/java/org/codelibs/fess/api/json/JsonApiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,34 +138,32 @@ protected void processScrollSearchRequest(final HttpServletRequest request, fina
final JsonRequestParams params = new JsonRequestParams(request, fessConfig);
try {
response.setContentType("application/x-ndjson; charset=UTF-8");
final long count =
searchService.scrollSearch(params, doc -> {
buf.setLength(0);
buf.append('{');
boolean first2 = true;
for (final Map.Entry<String, Object> entry : doc.entrySet()) {
final String name = entry.getKey();
if (StringUtil.isNotBlank(name) && entry.getValue() != null
&& ComponentUtil.getQueryHelper().isApiResponseField(name)) {
if (!first2) {
buf.append(',');
} else {
first2 = false;
}
buf.append(escapeJson(name));
buf.append(':');
buf.append(escapeJson(entry.getValue()));
}
}
buf.append('}');
buf.append('\n');
try {
response.getWriter().print(buf.toString());
} catch (final IOException e) {
throw new IORuntimeException(e);
final long count = searchService.scrollSearch(params, doc -> {
buf.setLength(0);
buf.append('{');
boolean first2 = true;
for (final Map.Entry<String, Object> entry : doc.entrySet()) {
final String name = entry.getKey();
if (StringUtil.isNotBlank(name) && entry.getValue() != null) {
if (!first2) {
buf.append(',');
} else {
first2 = false;
}
return true;
}, OptionalThing.empty());
buf.append(escapeJson(name));
buf.append(':');
buf.append(escapeJson(entry.getValue()));
}
}
buf.append('}');
buf.append('\n');
try {
response.getWriter().print(buf.toString());
} catch (final IOException e) {
throw new IORuntimeException(e);
}
return true;
}, OptionalThing.empty());
response.flushBuffer();
if (logger.isDebugEnabled()) {
logger.debug("Loaded " + count + " docs");
Expand Down
45 changes: 27 additions & 18 deletions src/main/java/org/codelibs/fess/app/service/SearchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.codelibs.fess.app.service;

import java.text.NumberFormat;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
Expand All @@ -43,6 +42,7 @@
import org.codelibs.fess.es.client.FessEsClientException;
import org.codelibs.fess.helper.QueryHelper;
import org.codelibs.fess.helper.SystemHelper;
import org.codelibs.fess.helper.ViewHelper;
import org.codelibs.fess.mylasta.action.FessUserBean;
import org.codelibs.fess.mylasta.direction.FessConfig;
import org.codelibs.fess.util.ComponentUtil;
Expand Down Expand Up @@ -107,7 +107,7 @@ public void search(final SearchRequestParams params, final SearchRenderData data
fessConfig.getIndexDocumentSearchIndex(),
fessConfig.getIndexDocumentType(),
searchRequestBuilder -> {
fessConfig.processSearchPreference(searchRequestBuilder, userBean);
queryHelper.processSearchPreference(searchRequestBuilder, userBean);
return SearchConditionBuilder.builder(searchRequestBuilder)
.query(StringUtil.isBlank(sortField) ? query : query + " sort:" + sortField).offset(pageStart)
.size(pageSize).facetInfo(params.getFacetInfo()).geoInfo(params.getGeoInfo())
Expand Down Expand Up @@ -192,29 +192,38 @@ public long scrollSearch(final SearchRequestParams params, final Function<Map<St
fessConfig.getIndexDocumentSearchIndex(),
fessConfig.getIndexDocumentType(),
searchRequestBuilder -> {
fessConfig.processSearchPreference(searchRequestBuilder, userBean);
return SearchConditionBuilder.builder(searchRequestBuilder)
queryHelper.processSearchPreference(searchRequestBuilder, userBean);
return SearchConditionBuilder.builder(searchRequestBuilder).scroll()
.query(StringUtil.isBlank(sortField) ? query : query + " sort:" + sortField).size(pageSize)
.responseFields(queryHelper.getResponseFields()).searchRequestType(params.getType()).build();
.responseFields(queryHelper.getScrollResponseFields()).searchRequestType(params.getType()).build();
},
(searchResponse, hit) -> {
final Map<String, Object> docMap = new HashMap<>();
final Map<String, Object> source = hit.getSourceAsMap();
if (source != null) {
final Map<String, Object> docMap = new HashMap<>(source);
docMap.put(fessConfig.getIndexFieldId(), hit.getId());
docMap.put(fessConfig.getIndexFieldVersion(), hit.getVersion());
return docMap;
docMap.putAll(source);
}
final Map<String, DocumentField> fields = hit.getFields();
if (fields != null) {
final Map<String, Object> docMap =
fields.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> (Object) e.getValue().getValues()));
docMap.put(fessConfig.getIndexFieldId(), hit.getId());
docMap.put(fessConfig.getIndexFieldVersion(), hit.getVersion());
return docMap;
docMap.putAll(fields.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> (Object) e.getValue().getValues())));
}
return Collections.emptyMap();

final ViewHelper viewHelper = ComponentUtil.getViewHelper();
if (viewHelper != null && !docMap.isEmpty()) {
docMap.put(fessConfig.getResponseFieldContentTitle(), viewHelper.getContentTitle(docMap));
docMap.put(fessConfig.getResponseFieldContentDescription(), viewHelper.getContentDescription(docMap));
docMap.put(fessConfig.getResponseFieldUrlLink(), viewHelper.getUrlLink(docMap));
docMap.put(fessConfig.getResponseFieldSitePath(), viewHelper.getSitePath(docMap));
}

if (!docMap.containsKey(Constants.SCORE)) {
docMap.put(Constants.SCORE, hit.getScore());
}

docMap.put(fessConfig.getIndexFieldId(), hit.getId());
docMap.put(fessConfig.getIndexFieldVersion(), hit.getVersion());
return docMap;
}, cursor);
}

Expand Down Expand Up @@ -287,7 +296,7 @@ public OptionalEntity<Map<String, Object>> getDocumentByDocId(final String docId
}
builder.setQuery(boolQuery);
builder.setFetchSource(fields, null);
fessConfig.processSearchPreference(builder, userBean);
queryHelper.processSearchPreference(builder, userBean);
return true;
});

Expand All @@ -314,7 +323,7 @@ public List<Map<String, Object>> getDocumentListByDocIds(final String[] docIds,
builder.setQuery(boolQuery);
builder.setSize(fessConfig.getPagingSearchPageMaxSizeAsInteger().intValue());
builder.setFetchSource(fields, null);
fessConfig.processSearchPreference(builder, userBean);
queryHelper.processSearchPreference(builder, userBean);
return true;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ protected HtmlResponse redirectToLogin() {
}

protected HtmlResponse redirectToRoot() {
final String contextPath = request.getServletContext().getContextPath();
return systemHelper.getRedirectResponseToRoot(newHtmlResponseAsRedirect(StringUtil.isBlank(contextPath) ? "/" : contextPath));
return systemHelper.getRedirectResponseToRoot(newHtmlResponseAsRedirect("/"));
}

protected HtmlNext virtualHost(final HtmlNext path) {
Expand Down
24 changes: 2 additions & 22 deletions src/main/java/org/codelibs/fess/app/web/go/GoAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.codelibs.core.lang.StringUtil;
import org.codelibs.core.net.URLUtil;
Expand All @@ -40,7 +39,6 @@
import org.lastaflute.web.response.ActionResponse;
import org.lastaflute.web.response.HtmlResponse;
import org.lastaflute.web.response.StreamResponse;
import org.lastaflute.web.util.LaRequestUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -146,31 +144,13 @@ public ActionResponse index(final GoForm form) throws IOException {
return redirect(ErrorAction.class);
}
} else {
return redirect(targetUrl + hash);
return HtmlResponse.fromRedirectPathAsIs(targetUrl + hash);
}
} else {
return redirect(targetUrl + hash);
return HtmlResponse.fromRedirectPathAsIs(DocumentUtil.encodeUrl(targetUrl + hash));
}
}

protected ActionResponse redirect(final String url) {
final HttpServletRequest request2 = LaRequestUtil.getRequest();
final String enc = request2.getCharacterEncoding() == null ? Constants.UTF_8 : request2.getCharacterEncoding();
final StringBuilder buf = new StringBuilder(url.length() + 100);
for (final char c : url.toCharArray()) {
if (CharUtil.isUrlChar(c)) {
buf.append(c);
} else {
try {
buf.append(URLEncoder.encode(String.valueOf(c), enc));
} catch (final UnsupportedEncodingException e) {
buf.append(c);
}
}
}
return HtmlResponse.fromRedirectPathAsIs(buf.toString());
}

protected boolean isFileSystemPath(final String url) {
return url.startsWith("file:") || url.startsWith("smb:") || url.startsWith("ftp:");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ public ActionResponse index(final ThumbnailForm form) {

final File thumbnailFile = thumbnailManager.getThumbnailFile(doc);
if (thumbnailFile == null) {
if (fessConfig.isThumbnailEnabled()) {
thumbnailManager.offer(doc);
}
// 404
thumbnailManager.offer(doc);
throw responseManager.new404("Thumbnail for " + form.docId + " is under generating.");
}

Expand Down
Loading