ZKEACMS full-Site Search plug-in, zkeacms full-Site Search
ZKEACMS full-Site Search plug-in
Enable ZKEACMS to support search
Database Microstft SQL Server 2008R2 or above
The index of the page is mainly used MsSql full text index, if you do not understand the full text index, you can use the following link to understand the full text index related knowledge https://docs.microsoft.com/zh-cn/ SQL /relational-databases/search/full-text-search
Currently, only MsSql databases are supported. If you are not using the MsSql database, it does not matter. It will easily be transformed into a database-independent Elasticsearch, Solr, or other search components. Or use the full-text index of the corresponding database. We just made a scaffold.
Initialize Database
The database script is in the DbScripts directory. Full-text index database can be directly created under CMS data, or another database is created to store index data on the page.
Dbo. WebPages. Table. SQL
This script is used to create a WebPages table and create a Chinese full-text index for the table. If the database is not indexed independently, this script can be executed directly in the CMS database. If you want to use an independent database, manually create the data and execute the script in the new database.
Dbo. CMS_WidgetTemplate. SQL
This script isCMS Database. Add a search component.
Configure appsettings. json
This is the configuration file of the search plug-in.
ConnectionStringIndex database connection string
CommandDotnet command. If no Path or Linux is set, you may need to set the complete dotnet Path.
HostThe domain name or the address of a page. crawlers in the search plug-in will index all links under the domain name or page.
Index page
Before using the search plug-in, you must index all the pages.
Method 1
In the backgroundFull-Site SearchClick under the DirectoryStart IndexButton. Add permissions to the role first.
Method 2 (recommended)
As the page content is constantly changing, you need to regularly update the index page content. The search plug-in is actually a complete. net core program, which can be run using the dotnet command.dotnet ZKEACMS.Search.dll
. In this way, you can add a scheduled task to regularly start this search index program. Note that the configuration file (appsettings. json) must be in the same directory. In the development environment, you can right-click and choose "adjust"> Start a new instance to start the crawler.
Start search
Edit any page or add a page. Then addSearchPlug-ins.
Plug-in source code
Https://github.com/SeriaWei/ZKEACMS.Core/tree/search/src/ZKEACMS.Search
Source link: http://www.zkea.net/zkeacms/extend/detail/post-149