From a6bbef0937649cd92a4b378a8454a96e6110bd99 Mon Sep 17 00:00:00 2001 From: yo mama Date: Mon, 23 Mar 2015 15:57:36 -0700 Subject: moved things around --- sphinx_stuff/sphinx.conf | 51 +++++++++++++++++++++++++++++++++++++++++ sphinx_stuff/sphinx_commands.sh | 2 ++ sphinx_stuff/sphinxtest.pl | 10 ++++++++ 3 files changed, 63 insertions(+) create mode 100644 sphinx_stuff/sphinx.conf create mode 100644 sphinx_stuff/sphinx_commands.sh create mode 100644 sphinx_stuff/sphinxtest.pl (limited to 'sphinx_stuff') diff --git a/sphinx_stuff/sphinx.conf b/sphinx_stuff/sphinx.conf new file mode 100644 index 0000000..24d271b --- /dev/null +++ b/sphinx_stuff/sphinx.conf @@ -0,0 +1,51 @@ +source journal +{ + type = mysql + sql_host = localhost + sql_user = journal_user + sql_pass = journal_password + sql_db = journal +# sql_sock = /var/run/mysqld/mysqld.sock + sql_port = 3306 + + # indexer query + # document_id MUST be the very first field + # document_id MUST be positive (non-zero, non-negative) + # document_id MUST fit into 32 bits + # document_id MUST be unique + sql_query = \ + SELECT \ + `id`, `fulltext`, `image_url` \ + FROM \ + journals; +# +# sql_group_column = assembly +# sql_group_column = model + + # document info query + # ONLY used by search utility to display document information + # MUST be able to fetch document info by its id, therefore + # MUST contain '$id' macro + # + + sql_query_info = SELECT * FROM journals WHERE id=$id +} + +index journal +{ + source = journal + path = /home/pepper/sphinx/journal + morphology = stem_en + + min_word_len = 3 + min_prefix_len = 0 + min_infix_len = 3 +} + +searchd +{ + port = 3312 + log = /var/log/searchd/searchd.log + query_log = /var/log/searchd/query.log + pid_file = /var/log/searchd/searchd.pid +} diff --git a/sphinx_stuff/sphinx_commands.sh b/sphinx_stuff/sphinx_commands.sh new file mode 100644 index 0000000..d721456 --- /dev/null +++ b/sphinx_stuff/sphinx_commands.sh @@ -0,0 +1,2 @@ +sudo sphinx-indexer journal +sudo sphinx-searchd diff --git a/sphinx_stuff/sphinxtest.pl b/sphinx_stuff/sphinxtest.pl new file mode 100644 index 0000000..3ec4f14 --- /dev/null +++ b/sphinx_stuff/sphinxtest.pl @@ -0,0 +1,10 @@ +#!/usr/bin/perl +use Data::Dumper; +use Sphinx::Search; + +$sph = Sphinx::Search->new(); + +$results = $sph->SetMatchMode(SPH_MATCH_ALL) + ->SetSortMode(SPH_SORT_RELEVANCE) + ->Query("dolly"); +print Dumper $results; -- cgit v1.2.3-70-g09d2