![](https://i-blog.csdnimg.cn/blog_migrate/65f5be99c9906729b40e4dbbe129e95e.png)
wordpress使用
WordPress is a great content management system, but the default WordPress search feature is not so great. Many users find it inadequate and want to replace it with a better alternative. In the past we showed you how to add Google Search to WordPress site, and how to add an advanced search box in WordPress using Facetious. In this article, we will show you how to improve your WordPress search with SearchWP.
WordPress是一个很棒的内容管理系统,但是默认的WordPress搜索功能不是很好。 许多用户发现它不够用,并希望用更好的替代方法来代替它。 过去,我们向您展示了如何将Google搜索添加到WordPress网站 ,以及如何使用Facetious 在WordPress中添加高级搜索框 。 在本文中,我们将向您展示如何使用SearchWP改进WordPress搜索。
什么是SearchWP? (What is SearchWP?)
SearchWP is a WordPres search plugin offering an alternate to the default WordPress search feature. It is easy to use and displays more relevant results than the default WordPress search. After installation, it can replace your default WordPress search feature with the click of a button, and you would not need to add any extra code to your theme. It allows you to set weight for keywords in different positions. This means you can fine tune how it lists the results.
SearchWP是一个WordPres搜索插件,提供了默认WordPress搜索功能的替代产品。 与默认的WordPress搜索相比,它易于使用并显示更多相关结果。 安装后,只需单击一下按钮,即可替换默认的WordPress搜索功能,而无需在主题中添加任何额外的代码。 它使您可以为不同位置的关键字设置权重。 这意味着您可以微调其列出结果的方式。
SearchWP indexes your content so that search results can be displayed quickly. You can also decide to include or exclude any content you want. It can search PDF files too (only those that have text in them and are not encrypted). For users who want to use supplemental search engines for different areas of their websites, they can create supplemental search engines with different settings than the default search.
SearchWP将您的内容编入索引,以便可以快速显示搜索结果。 您还可以决定包含或排除所需的任何内容。 它也可以搜索PDF文件(仅包含文本且未加密的文件)。 对于想要在其网站的不同区域使用补充搜索引擎的用户,他们可以使用与默认搜索不同的设置来创建补充搜索引擎。
安装和设置SearchWP (Installation and Setting up SearchWP)
SearchWP is a premium plugin available at $24.99 for a single site license. After purchasing SearchWP, you need to install and activate it (See: How to install a WordPress plugin). Once it is installed, go to Settings » SearchWP. You will notice that the plugin is indexing your content. Depending on how much content you got on your site, it may take a while. However you can continue to work on your website because the indexing will keep running quietly in the background. You will see a notice on the settings page when the indexing is complete. Meanwhile you can configure the plugin settings:
SearchWP是一个高级插件,单个站点许可证的价格为24.99美元。 购买SearchWP后 ,您需要安装并激活它(请参阅: 如何安装WordPress插件 )。 安装完成后,转到设置»SearchWP 。 您会注意到该插件正在索引您的内容。 视您在网站上获得的内容而定,可能需要一段时间。 但是,您可以继续在网站上工作,因为索引将在后台保持安静运行。 索引编制完成后,您会在设置页面上看到一条通知。 同时,您可以配置插件设置:
![SearchWP Settings Screen SearchWP Settings Screen](https://i-blog.csdnimg.cn/blog_migrate/8a0a98576ec8b0afe1ed647e44daee49.png)
The plugin looks for your keyword in title, content, slug, categories, tags, excerpt and comments. You can assign weight to each content type from 1 to 10 where 10 being the highest. You can set different weighing rules for posts, pages, and media. You can also exclude any post IDs, categories, tags, etc. We would also recommend that you enable Keyword Stemming which will display results for stem keywords as well as the original search keyword. For example, run, runs, running will be displayed if user searched for run.
该插件会在标题,内容,条目,类别,标签,摘录和评论中查找您的关键字。 您可以为每种内容类型分配权重,范围为1到10,其中10为最高。 您可以为帖子,页面和媒体设置不同的称重规则。 您还可以排除任何帖子ID,类别,标签等。我们还建议您启用“ 关键字词干”功能 ,该功能将显示词干关键字和原始搜索关键字的结果。 例如,如果用户搜索运行,将显示运行,运行,运行。
Once you are done with settings, click on Save Changes. Note that even if you do not change any default settings, you will still need to click on save changes to save your search configuration.
完成设置后,点击保存更改 。 请注意,即使您不更改任何默认设置,您仍将需要单击保存更改来保存搜索配置。
SearchWP integrates itself with the default WordPress search. If your theme already has a search area, then you don’t need to do anything else. Try a couple of keywords and see the difference. In case, you do not have search on your site, you can go to Appearance » Widgets and drag-drop the search widget to your sidebar.
SearchWP将其自身与默认的WordPress搜索集成。 如果您的主题已经有一个搜索区域,则您无需执行其他任何操作。 尝试几个关键字,看看有什么不同。 如果您没有在站点上进行搜索,则可以转到外观»小部件,然后将搜索小部件拖放到侧边栏中。
使用Search WP在WordPress中搜索PDF文件内容 (Searching PDF File Contents in WordPress with Search WP)
If you run a website that hosts a lot of content in PDF file format, then allowing your users to search this content would help them find things quickly. SearchWP indexes content in your PDF files and displays them in search results. To enable this feature make sure that you check the Media checkbox on Settings » SearchWP page.
如果您运行的网站上拥有大量PDF文件格式的内容,那么允许用户搜索此内容将帮助他们快速找到内容。 SearchWP将PDF文件中的内容编入索引,并在搜索结果中显示它们。 要启用此功能,请确保选中设置»SearchWP页面上的媒体复选框。
In order for PDF search to work, your PDF file needs to be readable by the plugin. PDF files downloaded from Google Docs as PDF and encrypted PDF files may not appear in search. To see if SearchWP can read a PDF file, go to Media » Library and click on Edit link below the PDF file you want to check. You will see a SearchWP File Content box below the description. If your file contents appear correctly in the box, then this means that SearchWP can read and display it in search results.
为了使PDF搜索正常工作,插件必须可以读取您的PDF文件。 从Google文档下载为PDF的PDF文件和加密的PDF文件可能不会出现在搜索中。 要查看SearchWP是否可以读取PDF文件,请转到媒体»库 ,然后单击要检查的PDF文件下方的编辑链接。 您将在说明下方看到一个SearchWP File Content框。 如果文件内容正确显示在框中,则表示SearchWP可以读取并将其显示在搜索结果中。
![SearchWP displaying indexed content for a PDF file SearchWP displaying indexed content for a PDF file](https://i-blog.csdnimg.cn/blog_migrate/aabc5ec8e745f1888bd08d9958d55ce1.png)
In case your PDF file’s content is not displayed, you can copy and paste the contents in the SearchWP box and manually tell the plugin about the contents of the file. Though this is not an ideal situation, it would work if you do not have too many PDF files in your library.
如果未显示PDF文件的内容,则可以将内容复制并粘贴到SearchWP框中,然后手动告知插件有关文件内容的信息。 尽管这不是理想的情况,但是如果您的库中没有太多PDF文件,则可以使用。
We hope that this article helped you improve your WordPress Search using SearchWP. For questions and feedback, you can leave a comment below or reach us on Twitter and Facebook.
我们希望本文能帮助您使用SearchWP改进WordPress搜索。 对于问题和反馈,您可以在下面发表评论,或通过Twitter和Facebook与我们联系。
翻译自: https://www.wpbeginner.com/plugins/improve-wordpress-search-searchwp/
wordpress使用