`
hongtoushizi
  • 浏览: 365332 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

Ubuntu in Production: Install Sphinx Search, with PHP(转载)

阅读更多

 

转载自: http://fideloper.com/production-ubuntu-install-sphinx-search

 

If you need or want a great full-text search engine, and you decide on Sphinx Search, here's how to install it on Ubuntu. I'm using 12.04 LTS Ubuntu Server.

This assumes two things:

  1. You want to use Sphinx Search
  2. You'll be searching the Sphinx index with PHP

Note: This is how I got it to work with PHP after a few hours of testing. There may be better ways (Installing it easy, getting PHP to work with it had a road-bump).

Installing

$ sudo apt-get install sphinxsearch

Well, that was easy. Sphinx is now installed. It's three main scripts are:

  • indexer - Indexes the data based on configuration file
  • searchd - Search daemon that runs in background
  • search - CLI tool to test searches

Next, getting PHP to work with it. This is the tricky part. Documentation says to use PEAR/PECL. Try that, and you'll get an ugly error:

$ sudo pear install pecl/sphinx
... lots of ugly output
... blah blah blah, missing libsphinxclient

We need libsphinxclient. This means going to the binary and building it using make/make install. But fear not, this is pretty easy - and there's no need to compile php.

From there, you can follow these instructions to make libspshinxclient and install the PECL library:

$ tar -xvf sphinx-2.0.6-release.tar.gz #You're version may differ
$ cd sphinx-2.0.6-release/api/libsphinxclient
$ ./configure
$ make
$ sudo make install

Now, this should work:

$ sudo pecl install sphinx
$ echo "extension=sphinx.so" >> /etc/php5/conf.d/sphinx.ini
$ sudo service apache2 restart

Here is a same PHP class, config file, and a simpler version of the instructions above for setting up Sphinx Search in Ubuntu.

Here's a Symfony 2 Sphinx Search package.

 

Here's an example of setting up Sphinx and searching with it.

分享到:
评论

相关推荐

    php7的sphinx扩展,适用linux,mac

    3. 编译并安装扩展:运行`phpize`来配置编译环境,然后执行`./configure --with-sphinx=/path/to/sphinx`,最后使用`make && make install`完成编译和安装。 4. 更新PHP配置:将新安装的Sphinx扩展添加到php.ini文件...

    PHP 全文检索引擎 Sphinx 介绍

    Sphinx是一个高性能、开源的全文检索引擎,专为配合SQL数据库而设计,如MySQL和PostgreSQL,用于实现高效且专业的全文搜索功能。它的核心优势在于能够提供比数据库原生搜索更强大的搜索性能,并且易于集成到各种使用...

    Linux下php+sphinx实例

    在Linux环境中,构建一个基于PHP和Sphinx的搜索系统是一个高效且强大的解决方案,尤其适用于大数据量的全文检索。本文将详细介绍如何在Linux下配置和使用PHP与Sphinx进行实际操作。 首先,Sphinx是一个开源的全文...

    pocketsphinx-android-demo资源包

    《探索pocketsphinx-android-demo:语音识别在Android平台的应用》 在移动设备上,语音识别技术已经成为人机交互的重要组成部分,极大地提升了用户体验。本资源包——"pocketsphinx-android-demo",是专为Android...

    sphinx-autobuild:监视Sphinx目录,并在检测到更改时重建文档。 还包括启用了livereload的Web服务器

    可以使用pip安装: pip install sphinx-autobuild用法要构建经典的Sphinx文档集,请运行: sphinx-autobuild docs docs/_build/html这将在启动服务器,并开始监视docs/目录中的更改。 当在docs/检测到更改时,将...

    introduction to search with sphinx

    介绍sphinx使用的文档,英文版,详细介绍了使用和配置

    语音识别技术学习:CMU Sphinx

    NULL 博文链接:https://wushexu.iteye.com/blog/2005734

    confluencebuilder:用于Sphinx的Confluence Markup Builder插件

    狮身人面像的Atlassian Confluence Builder 扩展,用于构建Confluence... 用于Sphinx的Atlassian Confluence Builder-安装 用法 在项目的配置脚本( conf.py )中注册扩展名sphinxcontrib.confluencebuilder : ext

    Laravel开发-sphinx-search-laravel

    本项目“Laravel开发-sphinx-search-laravel”就是针对Laravel框架集成Sphinx Search的一个实现,主要涉及Laravel的Sphinx搜索容器绑定和配置。 首先,要理解Laravel的依赖注入和容器。Laravel的依赖注入容器是框架...

    PHP搜索引擎Sphinx使用教程.zip

    描述中的“JAVA有ElasticSearch搜索引擎,我们PHP也有”暗示了尽管Java有一个强大的全文搜索引擎Elasticsearch,PHP也有类似的功能强大的解决方案——Sphinx。这表明开发者可以在PHP环境中享受到类似于Java的全文搜索...

    sphinx+xdict+安装说明.zip

    8. **测试搜索**:编写一个简单的Python脚本或使用Sphinx提供的`search`命令行工具,输入中文查询进行测试,验证安装和配置是否正确。 在实际应用中,你还需要考虑如何优化索引性能,比如调整索引的字段类型、设置...

    SphinxEdit:在线Sphinx编辑器

    狮身人面像在线Sphinx编辑器安装这些是一些安装说明(针对Debian或Ubuntu): sudo apt-get install python python-pip python-dev python-virtualenvsudo apt-get install poppler-utilssudo apt-get install ...

    sphinx-0.9.8.tar.gz

    Sphinx 是一个开源全文搜索引擎,它为各种编程语言(如Python、PHP、Java等)提供了API,使得开发者能够轻松地在自己的应用中集成强大的搜索功能。sphinx-0.9.8.tar.gz 是该软件的一个特定版本的源码包,打包格式为...

    sphinx-php7.3.zip

    Sphinx 是一个全文搜索引擎库,它为 PHP 和其他多种编程语言提供了接口,使得开发者能够方便地集成全文搜索功能到他们的应用程序中。在这个特定的压缩包 "sphinx-php7.3.zip" 中,包含的是未编译的 Sphinx 代码,...

    sphinx安装包,不错的东西

    4. **安装**:使用`make install`命令将Sphinx安装到系统路径中。 5. **配置**:编辑Sphinx的配置文件(如`/etc/sphinx.conf`),配置数据源、索引、搜索服务等相关设置。 6. **创建索引**:使用`indexer`工具创建或...

    sphinx-fortran:对Sphinx的Fortran域和autodoc扩展

    5. **与其他 Sphinx 扩展的兼容性**:作为 Sphinx 的扩展,`sphinx-fortran` 可以与其它 Sphinx 插件无缝集成,例如,你可以使用 `sphinx_rtd_theme` 来改变文档的样式,或者使用 `sphinxcontrib-bibtex` 添加参考...

    sphinx扩展,适用linux

    例如,在 Ubuntu 上可以使用 `sudo apt-get install libmysqlclient-dev libprotobuf-dev protobuf-compiler libprotobuf-c-dev libcurl4-openssl-dev libxml2-dev libssl-dev` 来安装必要的依赖。 2. **重新编译 ...

    php+mysql+sphinx实现近实时索引

    "php+mysql+sphinx"的组合是实现近实时索引的一种常见方案,尤其适用于内容丰富的网站和应用。下面我们将详细探讨这三个组件如何协同工作以实现这一目标。 首先,PHP是一种广泛使用的服务器端脚本语言,尤其适合...

    sphinx软件包

    6. ** faceted search(分面搜索)**:Sphinx 可以实现分面搜索,让用户在搜索结果中按照类别、标签或其他属性筛选,提供更精细的搜索体验。 7. **分布式搜索**:Sphinx 支持多台服务器间的分布式搜索,可以轻松...

    sphinx+mysql 安装手册

    **Sphinx+MySQL安装手册** Sphinx是一款高性能的全文搜索引擎,常用于构建高效的数据检索系统。结合MySQL数据库,可以构建出强大的、适用于千万级数据的全文检索解决方案。本手册将详细讲解如何在生产环境中安装和...

Global site tag (gtag.js) - Google Analytics