我正在尝试执行一个查询,就像从文档中检索一个特定字段,我在执行查询时没有获取运行时错误,但我没有得到我应该从查询中检索的3个字段,只是日期和原点,但没有变量,应该返回所有变量的变量都是空值.我如何选择我只想在查询中检索的字段?
目前我的查询如下所示:
@Query(value = "id:?0", fields = {"?1","date","origin"})
List<Data> getRecord(String id,String field);
Run Code Online (Sandbox Code Playgroud) 我有一个 git repo,其中许多文件应该是 lfs,因为它们大于 100M。
环顾四周,我无法找到一步一步的指南来解释如何迁移具有许多分支的真实现有存储库以及 lfs 文件在子目录中的位置。
就我而言,大文件分布在存储库中,如下所示:
code/track1/file000.pkl
code/track3/dat000.bin
code/track4/pip000.pkl
code/subcode/track5/pip000.pkl
code/subcode/track5/pop000.model
Run Code Online (Sandbox Code Playgroud)
我想将 git 项目转换为 git lfs 只需使用git lfs migrate:
git lfs install
git lfs migrate import --include="*.pkl"
git lfs migrate import --include="*.bin"
git lfs migrate import --include="*.model"
git commit -m "migrating models"
Run Code Online (Sandbox Code Playgroud)
但这没有任何作用。
nothing to commit, working tree clean
Run Code Online (Sandbox Code Playgroud)
我想转换所有的存储库,我的意思是所有文件、历史记录以及所有现有分支。
换句话说,git lfs migrate现在看起来很稳定,但用户不太友好。
跑步git lfs track "*.pkl"似乎有效果:
modified: code/track1/file000.pkl
modified: code/track4/pip000.pkl
modified: code/subcode/track5/pip000.pkl
Run Code Online (Sandbox Code Playgroud)
但接下来该怎么办。我看到它将git lfs track开始跟踪新文件或已签入存储库的现有文件。
但历史又如何呢?我很挣扎,因为我不想最终得到一个混乱的存储库,我必须从头开始重新导入或者必须处理过滤器分支。
我找到了有关联接的文档和有关子查询的文档,但我不确定如何组合它们。
id我想通过(这是传入的变量)搜索某些内容。该结果将有一个sectionpath. 然后我想找到以该开头的所有文档sectionpath。我可以在一个查询中完成此操作吗?
到目前为止,这是我尝试过的:
sectionpath:_query_:"{!fl=sectionpath}id:<variable>"*
Run Code Online (Sandbox Code Playgroud)
我知道这不起作用,但这样做的目的是:给我以id 为 的文档sectionpath(这就是 * 的用途)开头的结果。我知道这离工作还很远,但我不知道如何接近我的意图。sectionpath<variable>
我也尝试过这样的事情:
{!join from=sectionpath to=sectionpath}_query_:"{!fl=sectionfullpath}id:<variable>"
Run Code Online (Sandbox Code Playgroud)
但这似乎正在回归一切。它似乎不受sectionpath的限制。
版本升级到 log4j 2.17.0 后,在单元测试期间引发了此异常:
java.lang.ClassNotFoundException: org.apache.logging.log4j.core.util.SetUtils
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
我正在尝试将我的"长"代码转换为更简单的lambda驱动代码.想法是从枚举中获取价值.如果第一个值更高或更低,则将其返回并将lambda从进一步打破.我不知道从哪里开始.Lambda从枚举中返回代码,它可以很好地计算差异.我的问题是,一旦发现差异,就会获得返回和/或破坏lambda的值.
代码不起作用:
BiFunction<Map<String, Integer>,Map<String, Integer>,Integer> biFunction = (m1, m2) -> {
enumWords.forEach(word -> {
Integer returnValue = 0;
if(m1.get(word) > m2.get(word)){
returnValue = m1.get(word).compareTo(m2.get(word));
break;
}
});
return returnValue;
};
Run Code Online (Sandbox Code Playgroud)
这是有效的代码(pre-lambda):
BiFunction<Map<String, Integer>,Map<String, Integer>,Integer> biFunction = (m1, m2) -> {
Integer returnValue = 0;
if(m1.get("Love") > m2.get("Love")){
returnValue = -1;
}else if(m1.get("Love") < m2.get("Love")){
returnValue = 1;
}else{
if(m1.get("You") > m2.get("You")){
returnValue = -1;
}else if(m1.get("You") < m2.get("You")){
returnValue = 1;
}else{
if(m1.get("Me") > m2.get("Me")){
returnValue = -1;
}else if(m1.get("Me") …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 macOS High Sierra 上安装 OpenVPN
我已经克隆了 github 仓库:
git clone https://github.com/OpenVPN/openvpn
Run Code Online (Sandbox Code Playgroud)
并切换到最新的稳定分支:
git checkout origin release/2.4
Run Code Online (Sandbox Code Playgroud)
但是当我尝试构建项目时(按照INSTALL说明):
autoreconf -i -v -f
./configure
Run Code Online (Sandbox Code Playgroud)
我在这configure一步中遇到了这个错误:
配置:错误:lzo 已启用但丢失
即使在lzo使用 macos 端口安装依赖项后,问题仍然存在。
请帮助我的docker-compose文件。现在,我在docker文件中使用Solr,但是我需要将其更改为SolrCloud。我需要2个Solr实例,一个内部Zookeeper和docker(本地)。这是docker-compose我所做的文件的示例:
version: "3"
services:
mongo:
image: mongo:latest
container_name: mongo
hostname: mongo
networks:
- gsec
ports:
- 27018:27017
sqlserver:
image: microsoft/mssql-server-linux:latest
hostname: sqlserver
container_name: sqlserver
environment:
SA_PASSWORD: "#Password123!"
ACCEPT_EULA: "Y"
networks:
- gsec
ports:
- 1403:1433
solr:
image: solr
container_name: solr
ports:
- "8983:8983"
networks:
- gsec
volumes:
- data:/opt/solr/server/solr/mycores
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- mycore
volumes:
data:
networks:
gsec:
driver: bridge
Run Code Online (Sandbox Code Playgroud)
在此先感谢您。
我在Solr中有一个名为的核心test。我已经摄取了2个嵌套的JSON文档。它们如下:
{"id":1, "path":"1.parent", "_childDocuments_":{"path":"2.parent.child"}}
Run Code Online (Sandbox Code Playgroud)
和
{"id":2, "path":"1.parent", "_childDocuments_":{"path":"2.parent.child"}}
Run Code Online (Sandbox Code Playgroud)
当我test通过浏览器查询核心以寻求父子关系的响应时,我更正了回复:
http://localhost:8983/solr/test/select?fl=*,[child%20parentFilter=path:1.parent%20childFilter=path:2.parent.child]&indent=on&q={!parent%20which=%22path:1.parent%22}&wt=json
{
"responseHeader":{
"status":0,
"QTime":2,
"params":{
"q":"{!parent which=\"path:1.parent\"}",
"indent":"on",
"fl":"*,[child parentFilter=path:1.parent childFilter=path:2.parent.child]",
"wt":"json"}},
"response":{"numFound":2,"start":0,"docs":[
{
"id":"1",
"path":["1.parent"],
"_childDocuments_.path":["2.parent.child"],
"_version_":1565913168462479360},
{
"id":"2",
"path":["1.parent"],
"_childDocuments_.path":["2.parent.child"],
"_version_":1565913171789611008}]
}}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试通过curl它运行相同的查询时显示错误:
$ curl 'http://localhost:8983/solr/test/select?fl=*,[child%20parentFilter=path:1.parent%20childFilter=path:2.parent.child]&indent=on&q={!parent%20which=%22path:1.parent%22}&wt=json'
curl: (3) [globbing] bad range in column 46
Run Code Online (Sandbox Code Playgroud)
我无法理解。虽然,我可以理解,curl请求给错误上column 46是一个特殊字符[的http请求。但是,然后它如何在浏览器中工作,我们如何通过发出请求curl?
上传多个文件时,使用多路复用 http2 功能应该会显着提高性能。
Java 有一个 httpclient,它原生支持 HTTP/2 协议,因此我尝试编写代码以供自己理解。
这项任务似乎并不像我最初想的那样容易,或者在另一方面,我似乎无法找到能够在上传中使用多路复用的服务器(如果存在)。
这是我写的代码,有人有想法吗?
HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_2).build();
String url = "https://your-own-http2-server.com/incoming-files/%s";
Path basePath = Path.of("/path/to/directory/where/is/a/bunch/of/jpgs");
Function<Path, CompletableFuture<HttpResponse<String>>> handleFile = file -> {
String currentUrl = String.format(url, file.getFileName().toString());
try {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(currentUrl))
.header("Content-Type", "image/jpeg")
.PUT(HttpRequest.BodyPublishers.ofFile(file))
.build();
return httpClient.sendAsync(request, HttpResponse.BodyHandlers.ofString());
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
};
List<Path> files = Files.list(basePath).collect(toList());
files.parallelStream().map(handleFile).forEach(c -> {
try {
final HttpResponse<String> response = c.get();
System.out.println(response.statusCode());
} catch (Exception e) {
e.printStackTrace(); …Run Code Online (Sandbox Code Playgroud)