问题描述
我的网站上已安装并运行了Sphider搜索引擎,但遇到两个问题.
I have Sphider search engine up and running on my site but I am having two problems.
-
我不清楚如何设置索引以正确显示结果.
I am not clear on how to set up the indexing for the results to properly show up.
我正在尝试使用search.php文件和
I am trying to take the search.php file and
include ('sphider/search.php');
位于我网站根目录中的dashboard.php文件中的
.
in the dashboard.php file which is located in the root dir of my site.
Sphider在
root/sphider/search.php
但是当我包含它时,什么都没有显示.如果有人对我的问题有任何见解,我将不胜感激.是的,我在各处都找到了一些在线文档,但是没有任何东西可以帮我解决这个问题.
but when I include it nothing shows up. If anyone has any insight on the issues I am having I would appreciate it. Yes I have found some online documentation here and there but nothing that clears this up for me.
推荐答案
因为sphider未安装在根目录中,因此您可能需要更新search.php中的某些路径.在所有内容的路径中添加另一个"../sphider/",以便它可以引用所需的php文件等.这种方法会变得非常复杂,可能不值得.
because sphider is not installed in root directory You might need to update some of your path(s) within search.php eg. add another '../sphider/' in the path of everything so it can reference required php files etc. this way can get very complicated and is probably not worth it.
对于我的网站,我创建了一个简单的Flash搜索框,该框使用URL请求'search.php?query ='+ KeywordVar +'& start = 1& search = 1& results = 10'效果很好.
For my site I created a simple flash search box that usesURL request of 'search.php?query=' + KeywordVar + '&start=1&search=1&results=10'Works great.
AS3示例:
var KeywordVar = SearchTextBox01.text;
var URLpart1 = 'http://www.yourwebsite.com/search.php?query=';
var URLpart2 = '&start=1&search=1&results=10';
var MySearchLink = URLpart1 + KeywordVar + URLpart2;
MySearchButton.addEventListener(MouseEvent.CLICK,MySearchFunction);
function MySearchFunction(e:Event){navigateToURL(new URLRequest(MySearchLink)); }
在您的情况下,我将只使用一种简单的形式,将"get"用于搜索"Search.php"文件,然后包括您的标题& Sphider页眉&中的页脚页脚模板.或创建自己的标题&页脚以符合您的要求.
In your case I would just use a simple form that uses 'get' to the search 'Search.php' file and theninclude your header & footer in the Sphider's header & footer Templates. or create your own header & footers to match your requirements.
HTML示例:
<div>
<form action="sphider/search.php" method="get">
<input type="text" name="query" id="query" size="40" value="">
<input type="submit" value="Search">
<input type="hidden" name="search" value="1">
</form>
</div>
这篇关于将Sphider搜索引擎集成到网站中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!