我的页面上有一个搜索字段,该搜索字段应该搜索多个索引。我可以毫无问题地搜索一个索引,如 spring-data-elasticsearch 文档中所述。
但是,如果我搜索,例如“Foo”,我希望得到以下列表作为按相关性排序的结果:
{ title: "Foo" } -> Entity: Sample
{ name: "FooTest" } -> Entity: Test
{ title: "FooSample2" } -> Entity: Sample
// ...and so on
// The entities are not part of the same parent. So, they are complete different.
Run Code Online (Sandbox Code Playgroud)
为此,我在文档中找不到任何对我有帮助的内容。
有人可以帮忙吗?
编辑:
final SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(QueryBuilders.matchAllQuery())
.withIndices("game-index", "lets-play-index", "video-index", "genre-index", "platform-index", "user-index")
.withPageable(new PageRequest(0, 10))
.build();
// when
final Page<SearchResult> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery, SearchResult.class, new SearchResultMapper() {
@Override
public <T> FacetedPage<T> mapResults(
final …
Run Code Online (Sandbox Code Playgroud) 我是 C++ 新手,我错过了很多关于它的知识。大多数情况下,我都是通过尝试和错误来完成工作的。但现在我坚持使用uWebSockets为 websocket 服务器设置一个测试项目。不幸的是,没有可用的安装文档,并且它不能作为 C 库提供。
我克隆了 repo 递归(因为有子模块uSockets
)并执行了make
和make install
。到目前为止一切顺利,没有错误。
我尝试在 eclipse 中创建一个新的托管 C++ 项目,并添加一个main.cpp
包含该文件src/
内容的文件
我将“包含路径”设置为/usr/local/include
/root/uWebSockets/uSockets/src
和/usr/local/include/uWebSockets
我还将编译器方言设置为版本 c++17 (因为这是 uWebSockets 所必需的)
现在我在构建过程中遇到了很多错误,但我不知道如何解决它们:
13:58:48 **** Incremental Build of configuration Debug for project websocket-test ****
make all
Building file: ../src/main.cpp
Invoking: GCC C++ Compiler
g++ -std=c++17 -I/usr/local/include -I/root/uWebSockets/uSockets/src -I/usr/local/include/uWebSockets -O0 -g3 -Wall -Wconversion -c -fmessage-length=0 -pthread -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.cpp"
Finished …
Run Code Online (Sandbox Code Playgroud) 虽然我已经使用表对象和onAfterRendering函数成功创建了一个简单的项目,但我意识到只是实现onAfterRendering函数会改变外观并禁用表对象的某些功能.标题与列不对齐,左侧行选择器聚集,滚动条不起作用.
我已经看到这种情况发生在我尝试过的任何表对象上.作为一个例子,我从SDK中获取了SAP的Fixed Columns示例,添加了onAfterRendering函数,没有内容并查看问题.我将列宽更改为50px或100px,这使问题更加明显.
我正在执行placeAt语句之后的函数.我正在使用带有SAPUI5 1.24.4的Eclipse Luna.
//Bring the table onto the UI
oTable2.placeAt("sample2");
oTable2.onAfterRendering = function(){
};
Run Code Online (Sandbox Code Playgroud)