根据字段分组结果 - Lucene(Groupping results based on fields - Lucene)
我正在使用Lucene 4.10.4。 我想从20个不同的领域以非常有效的方式获得“n个结果”,而无需搜索20次。 如果我使用布尔查询搜索,我们可能会在单个搜索中获得所有结果。 我想根据字段对结果进行分组,是否有任何分组概念?
I'm using Lucene 4.10.4. I want to take "n results" from 20 different fields in an efficient way without searching 20 times. If I search using boolean query, we might get all the results in single search. I want to group results based on fields, is there any grouping concept?
原文:https://stackoverflow.com/questions/42291516
最满意答案
您可以使用nodeJs中提供的“http”模块发出http请求,然后处理从api调用收到的响应。 请看下面的例子
var http = require('http'); var options = { host: 'example.com', port: 80, path: '/foo.html' }; http.get(options, function(resp){ resp.on('data', function(chunk){ //do something with chunk }); }).on("error", function(e){ console.log("Got error: " + e.message); });
You can use "http" module available in nodeJs to make http request and then process the response recieved from the api call. Look at the below example
var http = require('http'); var options = { host: 'example.com', port: 80, path: '/foo.html' }; http.get(options, function(resp){ resp.on('data', function(chunk){ //do something with chunk }); }).on("error", function(e){ console.log("Got error: " + e.message); });
相关问答
更多-
不推荐由量角器的当前维护者: https://github.com/angular/protractor/issues/9#issuecomment-19927049 量角器和业力不能一起使用; 而是提供单独的运行测试系统。 量角器和因果关系覆盖测试的不同方面 - 因果关系主要用于单元测试,而量角器应用于端到端测试。 量角器构建在WebDriverJS之上,WebDriverJS使用Selenium / WebDriver服务器来配置浏览器并驱动测试执行。 纯WebDriverJS的例子可以在这里找到: h ...
-
您可以使用Protractor测量角度2应用 (从量角器2.5.0开始)。 对于量角器5.0.0+ ,您不必做任何具体操作, 量角器将自动检测在测试应用程序中使用的角度版本 。 对于量角器> = 2.5.0和<= 4.0.14,您只需要在您的配置中添加useAllAngular2AppRoots: true 。 这是一个例子 。 请注意,几个内置的量角器匹配器将不会与Angular2一起使用,请参阅: 量角器角度2失败:未知错误:角度未定义 在Firefox中还存在量角器+ Angular2问题(仍未解决) ...
-
量角器测试与长轮询(Protractor test vs long-polling)[2022-03-14]
你可以将对$resource的调用放入一个使用Protractor的browser.addMockModule()模拟出来的服务吗? 这样,Protractor将始终覆盖您的原始服务,然后才有机会运行。 这可能看起来像 // in your application myModule.service('myNotificationService', function($resource) { this.notification = $resource('/notification').get(); }); ... -
这已经有一段时间了,但我已经通过以下辅助方法成功测试了带有量角器的Ionic: waitForIonic: function () { //Register a promise with protractor, so the browser waits for it var deferred = protractor.promise.defer(); let clickBlock = element(by.css('.click-block-active')); //if ...
-
在量角器中测试承诺(Testing promises in protractor)[2021-12-14]
是的, expect() ,如果与Protractor ,可以理解承诺 - 它可以在做出预期之前解决一个承诺,使编写Protractor测试更容易。 这实际上是在Protractor依赖的单独项目中完成的jasminewd2 修补 jasmine的expect()以解析promises并包装jasmine的describe() , it()和其他测试控制块函数在Control Flow中执行。 请注意,它还支持断言双方的 promise,您可以这样做,例如: let elementText1 = $('.n ... -
如果我更新angularjs,是否需要重写量角器测试?(If I update angularjs, do I need to rewrite protractor tests?)[2023-07-25]
AngularJS V1.6版本附带了一个比平常更长的更改列表。 为了给你一个提醒,下面简要总结一下预计会产生最大影响的重大变化。 确保您在下面的完整列表中查看它们或查看相应的提交以获取更多信息。 $ location现在使用'!' 作为hash-bang URL的默认哈希前缀,而不是空字符串。 $ compile将(默认情况下)不预先为组件/指令控制器实例分配绑定。 由于安全原因,http对JSONP请求施加了额外的限制 对input [type = range]的改进支持意味着范围输入(绑定到ngMod ... -
您可以使用nodeJs中提供的“http”模块发出http请求,然后处理从api调用收到的响应。 请看下面的例子 var http = require('http'); var options = { host: 'example.com', port: 80, path: '/foo.html' }; http.get(options, function(resp){ resp.on('data', function(chunk){ //do something with ...
-
Protractor是一个非常强大的工具,用于测试您的应用程序,验证,导航甚至CRUD操作(创建,读取,更新和删除)。 例如,我正在为角度应用程序开发端到端测试,我会完成用户应该经历的每一步,并检查它可能出错的地方。 如果用户输入了错误的电子邮件,验证是否会出现? 您可以生成每次启动网站的新版本时运行的测试列表。 Protractor is a very powerful tool to test your application, validation, navigation or even CRUD-o ...
-
使用量角器测试功能(Testing functions using Protractor)[2024-02-10]
我认为你在这里有一个范围问题。 使用protractor ,您可以通过自动执行用户操作(点击,输入键,悬停等),从最终用户角度通过浏览器中打开的用户界面从一端到另一端测试应用程序。 要测试函数,您应该查看AngularJS单元测试 。 I think you have a scoping problem here. With protractor, you test your application from one end to another from an end-user perspective t ... -
我不确定这是否正是您正在寻找的,但您可以在Protractor中定义模拟服务,然后使用Protractors browser.addMockModule函数将它们上传到浏览器。 上传的模块将替换应用程序通常使用的真实模块。 有关更多详细信息,请参阅以下博文。 http://eitanp461.blogspot.com/2014/01/advanced-protractor-features.html I am not sure if this is exactly what you are looking ...