SphinxAutocompleteExample

  • 所有者: adriannuta/SphinxAutocompleteExample
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

SphinxAutocompleteExample

These samples illustrate autocomplete and type suggestion using Manticore/Sphinx search.
Querying is made via SphinxQL using PDO driver.
The sample data included contains a version of Sphinx documentation.
The samples are featured on [this Sphinx blog post] (http://sphinxsearch.com/blog/2013/05/21/simple-autocomplete-and-correction-suggestion/).

Requirements :

LAMP
Manticore or Sphinx search
PHP with PDO mysql

Installation :

Edit scripts/sphinx.conf for setting proper paths and db credentials
Import the sample tables in your database.
Untar first the two archieves in scripts folder:

$ tar -xzvf suggest.tar.gz 
$ tar -xzvf docs.tar.gz
$ mysql < suggest.sql
$ mysql < docs.sql

Alternative you can build the suggest table by following instructions in scripts/suggest/README

The samples use 3 indexes : simplecompletefull for doing the actual search, simplecomplete for autocomplete and suggest for suggestions.
simpletecompletefull can be used for autocomplete as well, if the search for completion is made only on title ( @title $query ).
Index the 3 indexes:

$ indexer -c /path/to/sphinx.conf --all

Start a new Manticore/Sphinx server using sphinx.conf from scripts folder or import the indexes if you already have a running Sphinx server.

$ searchd -c /path/to/sphinx.conf

In case you start a new Manticore/Sphinx server, be sure to change the ports in sphinx.conf and common.php.
In common.php edit the database credentials. For Sphinx 2.1.1 or greater/Manticore or trunk version, set constant SPHINX_20 to false.
Autocomplete starts after typing 3 characters. To change this you need to edit in sphinx.conf min_prefix_len and min_word_len and in footer.php and footer_excerpts.php the minLength ( which trigger firing the ajax call).

Live demo with Sphinx :

http://demos.sphinxsearch.com/SphinxAutocompleteExample/
License:

Sphinx Samples is free software, and is released under the terms of the GPL version 2 or (at your option) any later version.
Manticore website : https://manticoresearch.com/
Manticore repository : https://github.com/manticoresoftware/manticore
Sphinx website : http://sphinxsearch.com/
Sphinx read-only repository :https://github.com/sphinxsearch/sphinx

主要指標

概覽
名稱與所有者adriannuta/SphinxAutocompleteExample
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證
所有者活动
創建於2013-05-21 17:45:35
推送於2017-10-26 05:40:05
最后一次提交2017-10-26 08:40:05
發布數0
用户参与
星數89
關注者數13
派生數20
提交數26
已啟用問題?
問題數4
打開的問題數0
拉請求數1
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?