能够从文本框中复制值并粘贴到我的 html5 表单中的另一个文本框中。同样的方式我如何从日期字段复制值。
<input type="date" />
我想从一个日期字段复制值并将其粘贴到另一个日期字段。
100k我正在从一个索引中获取多个文档searchScroll,并在所有文档中再添加一个字段100K。然后再次将这些文档插入到另一个新索引中。
我正在使用SearchScrollapi 也正在设置大小,searchSourceBuilder.size(100)我已将大小增加到searchSourceBuilder.size(1000)。在这两种情况下,处理18100文档(当 searchSourceBuilder.size(100) 时)和21098文档(当 searchSourceBuilder.size(1000) 时)后都会出现以下错误。
search_context_missing_exception","reason":"No search context found for id
并且,错误抛出在这一行searchResponse = SearchEngineClient.getInstance().searchScroll(scrollRequest);
请找到我完整的错误堆栈
Exception in thread "main" ElasticsearchStatusException[Elasticsearch exception
[type=search_phase_execution_exception, reason=all shards failed]]; nested: Elas
ticsearchException[Elasticsearch exception [type=search_context_missing_exceptio
n, reason=No search context found for id [388]]];
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestR
esponse.java:177)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLeve
lClient.java:573)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(R
estHighLevelClient.java:549)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighL
evelClient.java:456)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEn
tity(RestHighLevelClient.java:429)
at org.elasticsearch.client.RestHighLevelClient.searchScroll(RestHighLev
elClient.java:387)
at com.es.utility.DocumentIndex.main(DocumentIndex.java:101)
Suppressed: org.elasticsearch.client.ResponseException: method [GET], …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 AND 运算符从具有多个字段的 elasticsearch 中获取文档
对于以下查询,我期待以下结果
AB-7000-8002-W
但我收到此错误消息 Unrecognized token 'get': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@40d2a7e8; line: 1, column: 5]
get my_index12/_search {
"query" : {
"bool": {
"should": [
{
"match": {
"code": {
"query": "AB-5000-6002-AK",
"operator": "and"
}
}
},
{
"match": {
"locale": {
"query": "en_US",
"operator": "and"
}
}
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
请在下面找到我的索引文件
{
"_index": "my_index12",
"_type": "doc",
"_id": "2",
"_score": 1,
"_source": {
"code": "AB-7000-8002-W",
"locale": "en_US"
}
}, …Run Code Online (Sandbox Code Playgroud) 我documents正在100K通过 java 代码查询比文档更多的弹性搜索索引。正在使用RestClient。
当我试图获取文件时 Exception in thread "main" java.io.IOException: listener timeout after waiting f
or [30000] ms
请找出以下错误:
D:\Karthikeyan\ElasticSearch\ElasticSearch_Tesing\target>java -jar ElasticSearch
Utility-1.0.0-SNAPSHOT-jar-with-dependencies.jar
ERROR StatusLogger No log4j2 configuration file found. Using default configurati
on: logging only errors to the console. Set system property 'log4j2.debug' to sh
ow Log4j2 internal initialization logging.
Jul 13, 2018 2:46:37 PM com.es.utility.DocumentIndex main
INFO: Started Indexing the Document.....
Request --->SearchRequest{searchType=QUERY_THEN_FETCH, indices=[documents], indi
cesOptions=IndicesOptions[id=38, ignore_unavailable=false, allow_no_indices=true
, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_mu
ltiple_indices=true, …Run Code Online (Sandbox Code Playgroud) 我已经Eureka Server使用 gradle 从 intellij 开始,服务器已按照日志启动并运行。404但使用以下网址在浏览器中出现错误
http://localhost:8761/eureka/
请从intellij控制台找到日志
2020-07-12 13:57:27.988 INFO 24624 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initializing ...
2020-07-12 13:57:27.990 INFO 24624 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Adding new peer nodes [http://localhost:8761/eureka/]
2020-07-12 13:57:28.370 INFO 24624 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2020-07-12 13:57:28.370 INFO 24624 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2020-07-12 13:57:28.370 INFO 24624 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2020-07-12 …Run Code Online (Sandbox Code Playgroud) 我在下面的匹配查询中搜索elasticsearch,它没有给我确切的匹配,而是给了我更多的无关紧要的匹配。
我正在使用elasticsearch 6.2.3
请在下面找到我的查询
get items/_search
{
"query" : {
"match" : {
"code" : "7000-8900"
}
}
}
Run Code Online (Sandbox Code Playgroud)
请找到响应从match查询中获取
7000-8900
7000-8002-WK
7000-8002-W
Run Code Online (Sandbox Code Playgroud) 我正在尝试从我的索引 (ElasticSearch) 中获取索引的 PDF 文档。我已经使用摄取附件处理器插件索引了我的 pdf 文档。共有 2500 份文档与 PDF 附件一起被索引。
现在我通过搜索 PDF 的内容来获取这些 PDF,并得到以下错误。
org.apache.http.ContentTooLongException: entity content is too long [105539255] for the configured buffer limit [104857600]
at org.elasticsearch.client.HeapBufferedAsyncResponseConsumer.onEntityEnclosed(HeapBufferedAsyncResponseConsumer.java:76)
at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.responseReceived(AbstractAsyncResponseConsumer.java:131)
at org.apache.http.impl.nio.client.MainClientExec.responseReceived(MainClientExec.java:315)
at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseReceived(DefaultClientExchangeHandlerImpl.java:147)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.responseReceived(HttpAsyncRequestExecutor.java:303)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:255)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "main" java.lang.NullPointerException
at com.es.utility.DocumentSearch.main(DocumentSearch.java:88)
Run Code Online (Sandbox Code Playgroud)
请找到我的 Java API 代码以从 ElasticSearch 中获取文档
private final static String ATTACHMENT = "document_attachment"; …Run Code Online (Sandbox Code Playgroud) 我有以下JSONArray试图对它进行排序.因此,为了将我的JSONArray转换为ArrayList,然后对它们进行排序并转换回JSONArray.
请找到最初的JSONArray(不在排序顺序中).
[
{
"code":"TE-7000-8003-W",
"id":"13342",
},
{
"code":"TE-7000-8003",
"id":"13163",
},
{
"code":"TE-7000-8003-WK",
"id":"11573",
},
{
"code":"TE-7000-8003S",
"id":"11565",
},
{
"code":"TE-7000-8003-K",
"id":"11557",
}
]
Run Code Online (Sandbox Code Playgroud)
请找到我的下面的代码,它将我的JSONArray转换为ArrayList并对它们进行排序.
Item item=null;
List<Item> newItemList = new ArrayList<Item>();
for (int i=0;i<resultJSONArray.length();i++) {
JSONObject jobj = resultJSONArray.getJSONObject(i);
item = new Item();
item.setId(jobj.optString("id"));
item.setCode(jobj.optString("code"));
newItemList.add(item);
}
newItemList
.stream()
.sorted((object1, object2) -> object1.getCode().compareTo(object2.getCode()));
Iterator<Item> itr = newItemList.iterator();
while(itr.hasNext()) {
Item item1=itr.next();
System.out.println("Item----->"+item1.getCode());
}
Run Code Online (Sandbox Code Playgroud)
以下是输出结果,而不是排序顺序
Item----->TE-7000-8003-W
Item----->TE-7000-8003
Item----->TE-7000-8003-WK
Item----->TE-7000-8003S
Item----->TE-7000-8003-K
Run Code Online (Sandbox Code Playgroud)
我期待如下结果:
Item----->TE-7000-8003
Item----->TE-7000-8003S
Item----->TE-7000-8003-K
Item----->TE-7000-8003-W
Item----->TE-7000-8003-WK
Run Code Online (Sandbox Code Playgroud) 我试图从.stream()via 2 打印值.filter().但价值不是印刷.
一个人.filter()能够打印值.
请在下面找到我的代码.
listProducts.stream()
.flatMap(listproducts -> listproducts.getProductAttr().stream())
.flatMap(attr ->attr.getProductAttrValue().stream())
.filter(av -> av.getLabel().equalsIgnoreCase("source"))
.filter(av -> av.getLabel().equalsIgnoreCase("description"))
.forEachOrdered(av -> System.out.println(av.getValue()));
Run Code Online (Sandbox Code Playgroud) 正在编写 Spring Boot 休息服务,以根据 _id (来自 elastic search )从 elastic search 获取产品。我能够打印来自服务的响应,意味着服务能够获取但在转换为 JSONObject 以返回到 UI 时抛出以下错误
No converter found for return value of type: class org.json.JSONObject
请在下面找到我的代码。
public JSONObject getProductById(String id){
String[] includes = new String[]{id};
String[] excludes = Strings.EMPTY_ARRAY;
GetRequest getRequest = new GetRequest(INDEX, TYPE, SOURCE);
getRequest.routing(id);
GetResponse getResponse = null;
try {
getResponse = restHighLevelClient.get(getRequest);
} catch (java.io.IOException e){
e.getLocalizedMessage();
}
//GetResponse getResponse = null;
// create the search request
SearchRequest searchRequest = new SearchRequest(INDEX);
searchRequest.types(TYPE);
// create …Run Code Online (Sandbox Code Playgroud) java ×9
kibana ×3
java-8 ×2
spring-boot ×2
filtering ×1
html ×1
java-stream ×1
javascript ×1
json ×1
rest ×1