如何在我的网站中创建全局搜索 [英] How to create a global search in my site

查看:89
本文介绍了如何在我的网站中创建全局搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的网站中创建全局搜索?该网站是内部网站,无法在网上使用,我无法为此使用Google搜索.

How can I create a global search in my site? The site is internal and not available on the net and I can't use Google Search for this.

我有全部存储在不同MySQL表中的信息.例如,帐户存储在帐户表中,帐户相关的地址存储在地址表中,电话号码存储在电话号码表中,联系人存储在联系人表中.....等.

I have information that is stored all in different MySQL tables. For example account are stored in the account table, account related addresses are stored in the addresses table, phone number in the phone number table, contact are stored in the contact table........etc.

我想创建一个搜索栏,它允许用户键入任何值,系统会找到它.因此,如果您搜索电话号码,则系统将找到该记录.如果您搜索帐户名,那么系统也会找到它.

I want to create a search bar it allow the user to type any value and the system will find it. So if you search for a phone number then the system will find the record. if you search for account name then the system will also find it.

如何构建它而不必要求用户选择他们要搜索的位置?

How can I build this without having to ask the user to select where do they want to search?

构建这样的全局搜索的方式是什么.注意,系统是用PHP编写的,数据存储在MySQL数据库中.并且系统中有很多记录.

What is the way to build such a global search. Note the the system is written in PHP and the data is stored in MySQL database. and there are lots of records in the system.

谢谢

推荐答案

我制作了一个php类,您可以

I made a php class that you can download it here and using that is quite easy... make an object for every search and use the result... either you can improve it yourself...

It will search all of your tables, and you can give the target column name or not...
read readMe.md file...
Hope this helps you...

这篇关于如何在我的网站中创建全局搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆