我安装了Sphinx Search作为我的搜索引擎,我正在尝试为搜索添加一些额外的功能setFilter(),SetSelect()这应该允许我做WHERE/AND条款.但每当我尝试搜索时,它都不会返回结果而不是结果.
这是我的sphinx.conf:http://pastebin.com/M6Kd71u0
这是PHP代码:
require("sphinxapi.php");
$host = "localhost";
$port = 9312;
$index = "llgenre";
$select1 = "cartoon";
$label6 = "children";
$type = 4;
$limit = 20;
$ranker = SPH_RANK_PROXIMITY_BM25;
$mode = SPH_MATCH_ALL;
$sphinx = new SphinxClient();
$sphinx->setServer($host, $port);
$sphinx->setConnectTimeout(0);
$sphinx->setMatchMode($mode);
$sphinx->setRankingMode($ranker);
$sphinx->setSelect('*, select1="'.$select1.'" AND label6="'.$label6.'" AS mycond');
$sphinx->setFilter('mycond', array(1));
$res = $sphinx->query($type, $index);
die(var_dump($res));
Run Code Online (Sandbox Code Playgroud)
我如何才能通过搜索type = 4,过滤由select1与cartoon最后在label6用children?
我想设置可以关闭窗口的按钮类型,所以我写了这段代码:
$(".fstandard").fancybox({
afterClose: function() {
alert("Closed!");
},
afterShow : function() {
$(':button').click(function() {
$.fancybox.close();
})
}
});
Run Code Online (Sandbox Code Playgroud)
我徒劳地尝试了其他几个代码,但没有一个工作,窗口没有关闭.这行给了我一个错误:
$.fancybox.close();
Run Code Online (Sandbox Code Playgroud)
$ .fancybox未定义
我使用FancyBox v2.0.3.在他们的文档中,很好地关闭了窗口:http://fancyapps.com/fancybox/#support
提前致谢
可能是因为更新,但我不知道为什么,我的 Makefiles 现在无法执行 docker。\n你有什么想法吗?
\n\xe2\x9e\xa4 cat Makefile \ndock:\n docker ps\nphp:\n php -v\n\xe2\x9e\xa4 make dock \ndocker ps\nmake: docker: Permission denied\nmake: *** [Makefile:2: dock] Error 127\n\xe2\x9e\xa4 make php 2 \xe2\x86\xb5\nphp -v\nPHP 7.4.28 (cli) (built: Feb 17 2022 16:17:19) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies\n\xe2\x9e\xa4 docker ps\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n9c1ff6f5e0dc postgres:14.2-alpine "docker-entrypoint.s\xe2\x80\xa6" 9 days ago Up 4 minutes 0.0.0.0:5434->5432/tcp, :::5434->5432/tcp digital-docker-c-postgres-1\nRun Code Online (Sandbox Code Playgroud)\n … 我试图简单地将我在PHP中请求的内容返回给JSON.我的问题是每个股票尚未完成.实际上,它是"渲染",但"this.collection.models"尚未完成,因为请求尚未完成.
我该怎么做才能解决这个问题,等到请求完成后才能正确完成循环.
先感谢您
var Article = Backbone.Model.extend({});
var Articles = Backbone.Collection.extend({
model:Article,
url: function() {
return _BASE_URL+'/sync/getLastArticles';
},
initialize:function () {
this.fetch();
}
});
var ArticlesView = Backbone.View.extend({
template:$('#articles').html(),
initialize:function () {
this.collection = new Articles();
this.render();
},
render:function () {
console.log(this.collection);
var that = this;
_.each(this.collection.models, function (item) {
console.log(item);
}, this);
},
renderArticle:function () {
;
}
});
Run Code Online (Sandbox Code Playgroud) 由于某种原因,我不明白这个功能,运行良好,但函数click()只运行一次.
$('#type').change(function() {
alert('ok');
$('#choixfiche').click();
});
Run Code Online (Sandbox Code Playgroud)
我该怎么纠正呢?
jquery ×2
backbone.js ×1
collections ×1
docker ×1
fancybox ×1
makefile ×1
model ×1
permissions ×1
php ×1
sphinx ×1