├── .gitmodules ├── .openshift ├── action_hooks │ ├── build │ ├── post_deploy │ └── post_start_postgresql-8.4 ├── cron │ ├── README.cron │ ├── daily │ │ ├── .gitignore │ │ ├── full_vacuum │ │ └── sphinx │ ├── hourly │ │ ├── .gitignore │ │ └── sphinx │ ├── minutely │ │ ├── .gitignore │ │ └── update-feeds │ ├── monthly │ │ └── .gitignore │ └── weekly │ │ ├── README │ │ ├── chrono.dat │ │ ├── chronograph │ │ ├── jobs.allow │ │ └── jobs.deny └── markers │ └── README ├── README.md ├── deplist.txt ├── libs └── .gitkeep ├── misc ├── .gitkeep ├── config.php ├── sed-sphinx.sh ├── sphinx.conf └── sphinx.sh └── sphinx ├── bin ├── indexer ├── indextool ├── search ├── searchd └── spelldump └── share └── man └── man1 ├── indexer.1 ├── indextool.1 ├── search.1 ├── searchd.1 └── spelldump.1 /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "php"] 2 | path = php 3 | url = https://tt-rss.org/gitlab/fox/tt-rss.git 4 | -------------------------------------------------------------------------------- /.openshift/action_hooks/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # This is a simple build script and will be executed on your CI system if 3 | # available. Otherwise it will execute while your application is stopped 4 | # before the deploy step. This script gets executed directly, so it 5 | # could be python, php, ruby, etc. 6 | echo "Entering build." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 7 | if [ -f ${OPENSHIFT_REPO_DIR}/php/config.php ]; then 8 | exit 0 9 | fi 10 | if [ ! -f ${OPENSHIFT_REPO_DIR}/php/config.php ]; then 11 | echo "Configuring TTRSS: Configuration" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 12 | cp ${OPENSHIFT_REPO_DIR}/misc/config.php ${OPENSHIFT_REPO_DIR}/php/config.php 13 | else 14 | echo "***WARNING***: Be sure to update \$OPENSHIFT_REPO_DIR/php/config.php with content" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 15 | echo "***WARNING***: from \$OPENSHIFT_REPO_DIR/misc/config.php" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 16 | fi 17 | 18 | # Set up various cache directories 19 | if [ ! -d ${OPENSHIFT_DATA_DIR}/ttrss ]; then 20 | echo "Configuring tt-rss cache directories"| tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 21 | mkdir -p ${OPENSHIFT_DATA_DIR}/ttrss 22 | cp -r ${OPENSHIFT_REPO_DIR}/php/{cache,lock} ${OPENSHIFT_DATA_DIR}/ttrss/ 23 | mv ${OPENSHIFT_REPO_DIR}/php/feed-icons ${OPENSHIFT_DATA_DIR}/ttrss/ 24 | else 25 | rm -rf ${OPENSHIFT_REPO_DIR}/php/feed-icons 26 | fi 27 | ln -sf ${OPENSHIFT_DATA_DIR}/ttrss/feed-icons ${OPENSHIFT_REPO_DIR}/php/feed-icons 28 | 29 | # Set up sphinx full-text search 30 | if [ ! -d ${OPENSHIFT_DATA_DIR}/run ]; then 31 | echo "Configuring Sphinx: Directories" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 32 | mkdir -p ${OPENSHIFT_DATA_DIR}/run 33 | mkdir -p ${OPENSHIFT_DATA_DIR}/sphinx/var/data 34 | mkdir -p ${OPENSHIFT_DATA_DIR}/sphinx/etc 35 | fi 36 | # Configure sphinx for current instance 37 | echo "Configuring Sphinx: Configuration" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 38 | ${OPENSHIFT_REPO_DIR}/misc/sed-sphinx.sh > ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf 39 | 40 | echo "Leaving build." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 41 | exit 0 42 | -------------------------------------------------------------------------------- /.openshift/action_hooks/post_deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # This is a simple post deploy hook executed after your application 3 | # is deployed and started. This script gets executed directly, so 4 | # it could be python, php, ruby, etc. 5 | 6 | echo "Entering post-deploy" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 7 | 8 | # Ensure db exists 9 | if [ -z ${OPENSHIFT_POSTGRESQL_DB_HOST} ]; then 10 | echo "Database environment not set!" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 11 | exit 0 12 | fi 13 | 14 | if [ -f ${OPENSHIFT_DATA_DIR}/.schema_deployed ]; then 15 | echo "Schema already deployed." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 16 | else 17 | echo "Creating database." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 18 | createdb -w ${OPENSHIFT_APP_NAME} 19 | echo "Deploying database schema." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 20 | psql -w -f ${OPENSHIFT_REPO_DIR}/php/schema/ttrss_schema_pgsql.sql ${OPENSHIFT_APP_NAME} && \ 21 | date >> ${OPENSHIFT_DATA_DIR}/.schema_deployed && \ 22 | echo "Schema deployed successfully." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 23 | fi 24 | 25 | echo "Updating sphinx." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 26 | # Set up sphinx full-text search 27 | if [ ! -d ${OPENSHIFT_DATA_DIR}/run ]; then 28 | echo "***ERROR***: Should have completed during deploy hook." 29 | echo "Configuring Sphinx: Directories" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 30 | mkdir -p ${OPENSHIFT_DATA_DIR}/run 31 | mkdir -p ${OPENSHIFT_DATA_DIR}/sphinx/var/data 32 | mkdir -p ${OPENSHIFT_DATA_DIR}/sphinx/etc 33 | # Configure sphinx for current instance 34 | echo "Configuring Sphinx: Configuration" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 35 | ${OPENSHIFT_REPO_DIR}/misc/sed-sphinx.sh > ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf 36 | fi 37 | 38 | # Update the feeds to get some initial data 39 | ${OPENSHIFT_REPO_DIR}/.openshift/cron/minutely/update-feeds 40 | 41 | echo "Starting sphinx." | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 42 | ${OPENSHIFT_REPO_DIR}/misc/sphinx.sh restart 43 | 44 | echo "Starting Indexer" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 45 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/indexer --rotate --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf ${OPENSHIFT_APP_NAME} 46 | echo "Leaving post-deploy" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log 47 | exit 0 48 | -------------------------------------------------------------------------------- /.openshift/action_hooks/post_start_postgresql-8.4: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # The pre_start_cartridge and pre_stop_cartridge hooks are *SOURCED* 4 | # immediately before (re)starting or stopping the specified cartridge. 5 | # They are able to make any desired environment variable changes as 6 | # well as other adjustments to the application environment. 7 | 8 | # The post_start_cartridge and post_stop_cartridge hooks are executed 9 | # immediately after (re)starting or stopping the specified cartridge. 10 | 11 | # Exercise caution when adding commands to these hooks. They can 12 | # prevent your application from stopping cleanly or starting at all. 13 | # Application start and stop is subject to different timeouts 14 | # throughout the system. 15 | 16 | -------------------------------------------------------------------------------- /.openshift/cron/README.cron: -------------------------------------------------------------------------------- 1 | Run scripts or jobs on a periodic basis 2 | ======================================= 3 | Any scripts or jobs added to the minutely, hourly, daily, weekly or monthly 4 | directories will be run on a scheduled basis (frequency is as indicated by the 5 | name of the directory) using run-parts. 6 | 7 | run-parts ignores any files that are hidden or dotfiles (.*) or backup 8 | files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} 9 | 10 | The presence of two specially named files jobs.deny and jobs.allow controls 11 | how run-parts executes your scripts/jobs. 12 | jobs.deny ===> Prevents specific scripts or jobs from being executed. 13 | jobs.allow ===> Only execute the named scripts or jobs (all other/non-named 14 | scripts that exist in this directory are ignored). 15 | 16 | The principles of jobs.deny and jobs.allow are the same as those of cron.deny 17 | and cron.allow and are described in detail at: 18 | http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Automating_System_Tasks.html#s2-autotasks-cron-access 19 | 20 | See: man crontab or above link for more details and see the the weekly/ 21 | directory for an example. 22 | 23 | -------------------------------------------------------------------------------- /.openshift/cron/daily/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/.openshift/cron/daily/.gitignore -------------------------------------------------------------------------------- /.openshift/cron/daily/full_vacuum: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Daily manual full-vacuum of the database to work around an Openshift bug 4 | # causing autovacuum not to work. 5 | # See https://bugzilla.redhat.com/show_bug.cgi?id=849428 which is a duplicate 6 | # of the non-accessible https://bugzilla.redhat.com/show_bug.cgi?id=806016 7 | echo "Vacuuming database..." 8 | vacuumdb -f --host=$OPENSHIFT_POSTGRESQL_DB_HOST --port=$OPENSHIFT_POSTGRESQL_DB_PORT 9 | returnvalue=$? 10 | echo "Vacuuming ended" 11 | 12 | exit $returnvalue 13 | -------------------------------------------------------------------------------- /.openshift/cron/daily/sphinx: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -f ${OPENSHIFT_DATA_DIR}/.schema_deployed ]; then 3 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/indexer --rotate --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf ${OPENSHIFT_APP_NAME} &> /dev/null 4 | fi 5 | exit 0 6 | -------------------------------------------------------------------------------- /.openshift/cron/hourly/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/.openshift/cron/hourly/.gitignore -------------------------------------------------------------------------------- /.openshift/cron/hourly/sphinx: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -f ${OPENSHIFT_DATA_DIR}/.schema_deployed ]; then 3 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/indexer --rotate --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf delta &> /dev/null 4 | fi 5 | exit 0 6 | -------------------------------------------------------------------------------- /.openshift/cron/minutely/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/.openshift/cron/minutely/.gitignore -------------------------------------------------------------------------------- /.openshift/cron/minutely/update-feeds: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -f ${OPENSHIFT_DATA_DIR}/.schema_deployed ]; then 3 | /usr/bin/php $OPENSHIFT_REPO_DIR/php/update.php --feeds --quiet &> $OPENSHIFT_PHP_LOG_DIR/rss_update.log 4 | fi 5 | exit 0 6 | 7 | -------------------------------------------------------------------------------- /.openshift/cron/monthly/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/.openshift/cron/monthly/.gitignore -------------------------------------------------------------------------------- /.openshift/cron/weekly/README: -------------------------------------------------------------------------------- 1 | Run scripts or jobs on a weekly basis 2 | ===================================== 3 | Any scripts or jobs added to this directory will be run on a scheduled basis 4 | (weekly) using run-parts. 5 | 6 | run-parts ignores any files that are hidden or dotfiles (.*) or backup 7 | files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} and handles 8 | the files named jobs.deny and jobs.allow specially. 9 | 10 | In this specific example, the chronograph script is the only script or job file 11 | executed on a weekly basis (due to white-listing it in jobs.allow). And the 12 | README and chrono.dat file are ignored either as a result of being black-listed 13 | in jobs.deny or because they are NOT white-listed in the jobs.allow file. 14 | 15 | For more details, please see ../README.cron file. 16 | 17 | -------------------------------------------------------------------------------- /.openshift/cron/weekly/chrono.dat: -------------------------------------------------------------------------------- 1 | Time And Relative D...n In Execution (Open)Shift! 2 | -------------------------------------------------------------------------------- /.openshift/cron/weekly/chronograph: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "`date`: `cat $(dirname \"$0\")/chrono.dat`" 4 | -------------------------------------------------------------------------------- /.openshift/cron/weekly/jobs.allow: -------------------------------------------------------------------------------- 1 | # 2 | # Script or job files listed in here (one entry per line) will be 3 | # executed on a weekly-basis. 4 | # 5 | # Example: The chronograph script will be executed weekly but the README 6 | # and chrono.dat files in this directory will be ignored. 7 | # 8 | # The README file is actually ignored due to the entry in the 9 | # jobs.deny which is checked before jobs.allow (this file). 10 | # 11 | chronograph 12 | 13 | -------------------------------------------------------------------------------- /.openshift/cron/weekly/jobs.deny: -------------------------------------------------------------------------------- 1 | # 2 | # Any script or job files listed in here (one entry per line) will NOT be 3 | # executed (read as ignored by run-parts). 4 | # 5 | 6 | README 7 | 8 | -------------------------------------------------------------------------------- /.openshift/markers/README: -------------------------------------------------------------------------------- 1 | Markers 2 | =========== 3 | 4 | Adding marker files to this directory will have the following effects: 5 | 6 | force_clean_build - Will remove all previous php pears and start installing 7 | required pears from scratch 8 | 9 | hot_deploy - Will prevent the apache process from being restarted during 10 | build/deployment 11 | 12 | disable_auto_scaling - Will prevent scalable applications from scaling up 13 | or down according to application load. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is an OpenShift quickstart for Tiny Tiny RSS. 2 | 3 | Creating an Openshift TT-RSS app: 4 | ================================= 5 | 6 | To create an Openshift TT-RSS instance: 7 | 8 | **Feel free to replace 'ttrss' with a different name.** 9 | 10 | $ rhc app create ttrss php-5.4 postgresql-9.2 cron-1.4 --from-code=https://github.com/disconn3ct/tiny_tiny_rss-openshift-quickstart.git --timeout=9999 11 | 12 | Application Options 13 | ------------------- 14 | Namespace: spaces 15 | Cartridges: php-5.4, postgresql-9.2, cron-1.4 16 | Gear Size: default 17 | Scaling: no 18 | 19 | Creating application 'ttrss' ... done 20 | 21 | Note that it may instead say: 22 | 23 | Creating application 'ttrss' ... Server returned an unexpected error code: 504 24 | 25 | That is ok, it is a bug with OpenShift. It probably succeeded, but you will have to manually clone the repo: 26 | 27 | $ rhc git-clone ttrss 28 | 29 | Once you have a repository (manually or automatically) you will probably want to add my repository as 'upstream': 30 | 31 | $ cd ttrss 32 | $ git remote add upstream -m master https://github.com/disconn3ct/tiny_tiny_rss-openshift-quickstart.git 33 | 34 | TTRSS is now installed! 35 | 36 | Updating the template: 37 | ====================== 38 | To update, just run a pull from my repo and push into the Openshift instance: 39 | 40 | $ git pull upstream master 41 | $ git push 42 | 43 | This will pull in any changes I've made, such as new release versions of TTRSS. It should not affect your existing data. It does take some time though, as Openshift goes through a complete application restart. 44 | 45 | Updating TTRSS: 46 | =============== 47 | If you want to change TTRSS versions without waiting for me, it is easy. 48 | 49 | First make sure the submodule is initialized in your local repo: 50 | 51 | $ git submodule update --init --recursive 52 | 53 | Then update as you like: 54 | 55 | Updating to master (latest commits): 56 | 57 | The first time, you have to set it to master: 58 | 59 | $ cd php 60 | $ git checkout master 61 | 62 | After that, all that is necessary is: 63 | 64 | $ cd php 65 | $ git pull 66 | $ cd .. 67 | $ git add php 68 | $ git commit -m "update to lastest ttrss" 69 | $ git push 70 | 71 | Updating to a specific tag/release (1.8 in this example): 72 | 73 | $ cd php 74 | $ git fetch 75 | $ git checkout 1.8 76 | $ cd .. 77 | $ git push 78 | -------------------------------------------------------------------------------- /deplist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/deplist.txt -------------------------------------------------------------------------------- /libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/libs/.gitkeep -------------------------------------------------------------------------------- /misc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/misc/.gitkeep -------------------------------------------------------------------------------- /misc/config.php: -------------------------------------------------------------------------------- 1 | System), syslog - logs to system log. 195 | // Setting this to blank uses PHP logging (usually to http server 196 | // error.log). 197 | 198 | define('CONFIG_VERSION', 26); 199 | // Expected config version. Please update this option in config.php 200 | // if necessary (after migrating all new options from this file). 201 | 202 | // vim:ft=php 203 | -------------------------------------------------------------------------------- /misc/sed-sphinx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | sed -e "s|##OPENSHIFT_POSTGRESQL_DB_HOST##|$OPENSHIFT_POSTGRESQL_DB_HOST|g" \ 3 | -e "s|##OPENSHIFT_POSTGRESQL_DB_USERNAME##|$OPENSHIFT_POSTGRESQL_DB_USERNAME|g" \ 4 | -e "s|##OPENSHIFT_POSTGRESQL_DB_PASSWORD##|$OPENSHIFT_POSTGRESQL_DB_PASSWORD|g" \ 5 | -e "s|##OPENSHIFT_POSTGRESQL_DB_PORT##|$OPENSHIFT_POSTGRESQL_DB_PORT|g" \ 6 | -e "s|##OPENSHIFT_APP_NAME##|$OPENSHIFT_APP_NAME|g" \ 7 | -e "s|##OPENSHIFT_DATA_DIR##|$OPENSHIFT_DATA_DIR|g" \ 8 | -e "s|##OPENSHIFT_PHP_IP##|$OPENSHIFT_PHP_IP|g" \ 9 | -e "s|##OPENSHIFT_PHP_LOG_DIR##|$OPENSHIFT_PHP_LOG_DIR|g" \ 10 | ${OPENSHIFT_REPO_DIR}/misc/sphinx.conf 11 | exit 0 -------------------------------------------------------------------------------- /misc/sphinx.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Sphinx configuration file sample 3 | # 4 | # WARNING! While this sample file mentions all available options, 5 | # it contains (very) short helper descriptions only. Please refer to 6 | # doc/sphinx.html for details. 7 | # 8 | 9 | ############################################################################# 10 | ## data source definition 11 | ############################################################################# 12 | 13 | source ##OPENSHIFT_APP_NAME## 14 | { 15 | # data source type. mandatory, no default value 16 | # known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc 17 | type = pgsql 18 | 19 | ##################################################################### 20 | ## SQL settings (for 'mysql' and 'pgsql' types) 21 | ##################################################################### 22 | 23 | # some straightforward parameters for SQL source types 24 | sql_host = ##OPENSHIFT_POSTGRESQL_DB_HOST## 25 | sql_user = ##OPENSHIFT_POSTGRESQL_DB_USERNAME## 26 | sql_pass = ##OPENSHIFT_POSTGRESQL_DB_PASSWORD## 27 | sql_db = ##OPENSHIFT_APP_NAME## 28 | sql_port = ##OPENSHIFT_POSTGRESQL_DB_PORT## # optional, default is 3306 29 | 30 | # UNIX socket name 31 | # optional, default is empty (reuse client library defaults) 32 | # usually '/var/lib/mysql/mysql.sock' on Linux 33 | # usually '/tmp/mysql.sock' on FreeBSD 34 | # 35 | # sql_sock = /tmp/mysql.sock 36 | 37 | 38 | # MySQL specific client connection flags 39 | # optional, default is 0 40 | # 41 | # mysql_connect_flags = 32 # enable compression 42 | 43 | # MySQL specific SSL certificate settings 44 | # optional, defaults are empty 45 | # 46 | # mysql_ssl_cert = /etc/ssl/client-cert.pem 47 | # mysql_ssl_key = /etc/ssl/client-key.pem 48 | # mysql_ssl_ca = /etc/ssl/cacert.pem 49 | 50 | # MS SQL specific Windows authentication mode flag 51 | # MUST be in sync with charset_type index-level setting 52 | # optional, default is 0 53 | # 54 | # mssql_winauth = 1 # use currently logged on user credentials 55 | 56 | 57 | # MS SQL specific Unicode indexing flag 58 | # optional, default is 0 (request SBCS data) 59 | # 60 | # mssql_unicode = 1 # request Unicode data from server 61 | 62 | 63 | # ODBC specific DSN (data source name) 64 | # mandatory for odbc source type, no default value 65 | # 66 | # odbc_dsn = DBQ=C:\data;DefaultDir=C:\data;Driver={Microsoft Text Driver (*.txt; *.csv)}; 67 | # sql_query = SELECT id, data FROM documents.csv 68 | 69 | 70 | # ODBC and MS SQL specific, per-column buffer sizes 71 | # optional, default is auto-detect 72 | # 73 | # sql_column_buffers = content=12M, comments=1M 74 | 75 | 76 | # pre-query, executed before the main fetch query 77 | # multi-value, optional, default is empty list of queries 78 | # 79 | sql_query_pre = SET client_encoding TO unicode 80 | # sql_query_pre = SET SESSION query_cache_type=OFF 81 | 82 | 83 | # main document fetch query 84 | # mandatory, integer document ID field MUST be the first selected column 85 | #sql_query = \ 86 | # SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \ 87 | # FROM documents 88 | 89 | sql_query = \ 90 | SELECT int_id AS id, ref_id, date_part('epoch', updated) AS updated, \ 91 | ttrss_entries.title AS title, link, content, \ 92 | ttrss_feeds.title AS feed_title, \ 93 | marked, published, unread, \ 94 | author, ttrss_user_entries.owner_uid \ 95 | FROM ttrss_entries, ttrss_user_entries, ttrss_feeds \ 96 | WHERE ref_id = ttrss_entries.id AND feed_id = ttrss_feeds.id 97 | 98 | # joined/payload field fetch query 99 | # joined fields let you avoid (slow) JOIN and GROUP_CONCAT 100 | # payload fields let you attach custom per-keyword values (eg. for ranking) 101 | # 102 | # syntax is FIELD-NAME 'from' ( 'query' | 'payload-query' ); QUERY 103 | # joined field QUERY should return 2 columns (docid, text) 104 | # payload field QUERY should return 3 columns (docid, keyword, weight) 105 | # 106 | # REQUIRES that query results are in ascending document ID order! 107 | # multi-value, optional, default is empty list of queries 108 | # 109 | # sql_joined_field = tags from query; SELECT docid, CONCAT('tag',tagid) FROM tags ORDER BY docid ASC 110 | # sql_joined_field = wtags from payload-query; SELECT docid, tag, tagweight FROM tags ORDER BY docid ASC 111 | 112 | 113 | # file based field declaration 114 | # 115 | # content of this field is treated as a file name 116 | # and the file gets loaded and indexed in place of a field 117 | # 118 | # max file size is limited by max_file_field_buffer indexer setting 119 | # file IO errors are non-fatal and get reported as warnings 120 | # 121 | # sql_file_field = content_file_path 122 | 123 | # range query setup, query that must return min and max ID values 124 | # optional, default is empty 125 | # 126 | # sql_query will need to reference $start and $end boundaries 127 | # if using ranged query: 128 | # 129 | # sql_query = \ 130 | # SELECT doc.id, doc.id AS group, doc.title, doc.data \ 131 | # FROM documents doc \ 132 | # WHERE id>=$start AND id<=$end 133 | # 134 | # sql_query_range = SELECT MIN(id),MAX(id) FROM documents 135 | 136 | 137 | # range query step 138 | # optional, default is 1024 139 | # 140 | # sql_range_step = 1000 141 | 142 | 143 | # unsigned integer attribute declaration 144 | # multi-value (an arbitrary number of attributes is allowed), optional 145 | # optional bit size can be specified, default is 32 146 | # 147 | # sql_attr_uint = author_id 148 | # sql_attr_uint = forum_id:9 # 9 bits for forum_id 149 | sql_attr_uint = owner_uid 150 | sql_attr_uint = ref_id 151 | 152 | # boolean attribute declaration 153 | # multi-value (an arbitrary number of attributes is allowed), optional 154 | # equivalent to sql_attr_uint with 1-bit size 155 | # 156 | # sql_attr_bool = is_deleted 157 | 158 | 159 | # bigint attribute declaration 160 | # multi-value (an arbitrary number of attributes is allowed), optional 161 | # declares a signed (unlike uint!) 64-bit attribute 162 | # 163 | # sql_attr_bigint = my_bigint_id 164 | 165 | 166 | # UNIX timestamp attribute declaration 167 | # multi-value (an arbitrary number of attributes is allowed), optional 168 | # similar to integer, but can also be used in date functions 169 | # 170 | # sql_attr_timestamp = posted_ts 171 | # sql_attr_timestamp = last_edited_ts 172 | #sql_attr_timestamp = updated 173 | 174 | # string ordinal attribute declaration 175 | # multi-value (an arbitrary number of attributes is allowed), optional 176 | # sorts strings (bytewise), and stores their indexes in the sorted list 177 | # sorting by this attr is equivalent to sorting by the original strings 178 | # 179 | # sql_attr_str2ordinal = author_name 180 | 181 | 182 | # floating point attribute declaration 183 | # multi-value (an arbitrary number of attributes is allowed), optional 184 | # values are stored in single precision, 32-bit IEEE 754 format 185 | # 186 | # sql_attr_float = lat_radians 187 | # sql_attr_float = long_radians 188 | 189 | 190 | # multi-valued attribute (MVA) attribute declaration 191 | # multi-value (an arbitrary number of attributes is allowed), optional 192 | # MVA values are variable length lists of unsigned 32-bit integers 193 | # 194 | # syntax is ATTR-TYPE ATTR-NAME 'from' SOURCE-TYPE [;QUERY] [;RANGE-QUERY] 195 | # ATTR-TYPE is 'uint' or 'timestamp' 196 | # SOURCE-TYPE is 'field', 'query', or 'ranged-query' 197 | # QUERY is SQL query used to fetch all ( docid, attrvalue ) pairs 198 | # RANGE-QUERY is SQL query used to fetch min and max ID values, similar to 'sql_query_range' 199 | # 200 | # sql_attr_multi = uint tag from query; SELECT docid, tagid FROM tags 201 | # sql_attr_multi = uint tag from ranged-query; \ 202 | # SELECT docid, tagid FROM tags WHERE id>=$start AND id<=$end; \ 203 | # SELECT MIN(docid), MAX(docid) FROM tags 204 | 205 | 206 | # string attribute declaration 207 | # multi-value (an arbitrary number of these is allowed), optional 208 | # lets you store and retrieve strings 209 | # 210 | # sql_attr_string = stitle 211 | 212 | 213 | # wordcount attribute declaration 214 | # multi-value (an arbitrary number of these is allowed), optional 215 | # lets you count the words at indexing time 216 | # 217 | # sql_attr_str2wordcount = stitle 218 | 219 | 220 | # combined field plus attribute declaration (from a single column) 221 | # stores column as an attribute, but also indexes it as a full-text field 222 | # 223 | # sql_field_string = author 224 | # sql_field_str2wordcount = title 225 | 226 | 227 | # post-query, executed on sql_query completion 228 | # optional, default is empty 229 | # 230 | # sql_query_post = 231 | 232 | 233 | # post-index-query, executed on successful indexing completion 234 | # optional, default is empty 235 | # $maxid expands to max document ID actually fetched from DB 236 | # 237 | # sql_query_post_index = REPLACE INTO counters ( id, val ) \ 238 | # VALUES ( 'max_indexed_id', $maxid ) 239 | 240 | 241 | # ranged query throttling, in milliseconds 242 | # optional, default is 0 which means no delay 243 | # enforces given delay before each query step 244 | sql_ranged_throttle = 0 245 | 246 | # document info query, ONLY for CLI search (ie. testing and debugging) 247 | # optional, default is empty 248 | # must contain $id macro and must fetch the document by that id 249 | sql_query_info = SELECT * FROM ttrss_entries, \ 250 | ttrss_user_entries WHERE ref_id = id AND int_id=$id 251 | 252 | # columns to unpack on indexer side when indexing 253 | # multi-value, optional, default is empty list 254 | # 255 | # unpack_zlib = zlib_column 256 | # unpack_mysqlcompress = compressed_column 257 | # unpack_mysqlcompress = compressed_column_2 258 | 259 | 260 | # maximum unpacked length allowed in MySQL COMPRESS() unpacker 261 | # optional, default is 16M 262 | # 263 | # unpack_mysqlcompress_maxsize = 16M 264 | 265 | 266 | ##################################################################### 267 | ## xmlpipe2 settings 268 | ##################################################################### 269 | 270 | # type = xmlpipe 271 | 272 | # shell command to invoke xmlpipe stream producer 273 | # mandatory 274 | # 275 | # xmlpipe_command = cat ##OPENSHIFT_REPO_DIR##/sphinx/var/test.xml 276 | 277 | # xmlpipe2 field declaration 278 | # multi-value, optional, default is empty 279 | # 280 | # xmlpipe_field = subject 281 | # xmlpipe_field = content 282 | 283 | 284 | # xmlpipe2 attribute declaration 285 | # multi-value, optional, default is empty 286 | # all xmlpipe_attr_XXX options are fully similar to sql_attr_XXX 287 | # 288 | # xmlpipe_attr_timestamp = published 289 | # xmlpipe_attr_uint = author_id 290 | 291 | 292 | # perform UTF-8 validation, and filter out incorrect codes 293 | # avoids XML parser choking on non-UTF-8 documents 294 | # optional, default is 0 295 | # 296 | # xmlpipe_fixup_utf8 = 1 297 | } 298 | 299 | source delta : ##OPENSHIFT_APP_NAME## { 300 | 301 | sql_query = \ 302 | SELECT int_id AS id, ref_id, date_part('epoch', updated) AS updated, \ 303 | ttrss_entries.title AS title, link, content, \ 304 | ttrss_feeds.title AS feed_title, \ 305 | marked, published, unread, \ 306 | author, ttrss_user_entries.owner_uid \ 307 | FROM ttrss_entries, ttrss_user_entries, ttrss_feeds \ 308 | WHERE ref_id = ttrss_entries.id AND feed_id = ttrss_feeds.id \ 309 | AND ttrss_entries.updated > NOW() - INTERVAL '24 hours' 310 | 311 | # kill-list query, fetches the document IDs for kill-list 312 | # k-list will suppress matches from preceding indexes in the same query 313 | # optional, default is empty 314 | # 315 | sql_query_killlist = \ 316 | SELECT int_id FROM ttrss_entries, ttrss_user_entries \ 317 | WHERE ref_id = ttrss_entries.id AND updated > NOW() - INTERVAL '24 hours' 318 | 319 | } 320 | 321 | # inherited source example 322 | # 323 | # all the parameters are copied from the parent source, 324 | # and may then be overridden in this source definition 325 | #source src1throttled : src1 326 | #{ 327 | # sql_ranged_throttle = 100 328 | #} 329 | 330 | ############################################################################# 331 | ## index definition 332 | ############################################################################# 333 | 334 | # local index example 335 | # 336 | # this is an index which is stored locally in the filesystem 337 | # 338 | # all indexing-time options (such as morphology and charsets) 339 | # are configured per local index 340 | index ##OPENSHIFT_APP_NAME## 341 | { 342 | # index type 343 | # optional, default is 'plain' 344 | # known values are 'plain', 'distributed', and 'rt' (see samples below) 345 | # type = plain 346 | 347 | # document source(s) to index 348 | # multi-value, mandatory 349 | # document IDs must be globally unique across all sources 350 | source = ##OPENSHIFT_APP_NAME## 351 | 352 | # index files path and file name, without extension 353 | # mandatory, path must be writable, extensions will be auto-appended 354 | path = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/##OPENSHIFT_APP_NAME## 355 | 356 | # document attribute values (docinfo) storage mode 357 | # optional, default is 'extern' 358 | # known values are 'none', 'extern' and 'inline' 359 | docinfo = extern 360 | 361 | # memory locking for cached data (.spa and .spi), to prevent swapping 362 | # optional, default is 0 (do not mlock) 363 | # requires searchd to be run from root 364 | mlock = 0 365 | 366 | # a list of morphology preprocessors to apply 367 | # optional, default is empty 368 | # 369 | # builtin preprocessors are 'none', 'stem_en', 'stem_ru', 'stem_enru', 370 | # 'soundex', and 'metaphone'; additional preprocessors available from 371 | # libstemmer are 'libstemmer_XXX', where XXX is algorithm code 372 | # (see libstemmer_c/libstemmer/modules.txt) 373 | # 374 | # morphology = stem_en, stem_ru, soundex 375 | # morphology = libstemmer_german 376 | # morphology = libstemmer_sv 377 | morphology = none 378 | 379 | # minimum word length at which to enable stemming 380 | # optional, default is 1 (stem everything) 381 | # 382 | # min_stemming_len = 1 383 | 384 | 385 | # stopword files list (space separated) 386 | # optional, default is empty 387 | # contents are plain text, charset_table and stemming are both applied 388 | # 389 | # stopwords = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/stopwords.txt 390 | 391 | 392 | # wordforms file, in "mapfrom > mapto" plain text format 393 | # optional, default is empty 394 | # 395 | # wordforms = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/wordforms.txt 396 | 397 | 398 | # tokenizing exceptions file 399 | # optional, default is empty 400 | # 401 | # plain text, case sensitive, space insensitive in map-from part 402 | # one "Map Several Words => ToASingleOne" entry per line 403 | # 404 | # exceptions = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/exceptions.txt 405 | 406 | 407 | # minimum indexed word length 408 | # default is 1 (index everything) 409 | min_word_len = 1 410 | 411 | # charset encoding type 412 | # optional, default is 'sbcs' 413 | # known types are 'sbcs' (Single Byte CharSet) and 'utf-8' 414 | charset_type = utf-8 415 | 416 | # charset definition and case folding rules "table" 417 | # optional, default value depends on charset_type 418 | # 419 | # defaults are configured to include English and Russian characters only 420 | # you need to change the table to include additional ones 421 | # this behavior MAY change in future versions 422 | # 423 | # 'sbcs' default value is 424 | # charset_table = 0..9, A..Z->a..z, _, a..z, U+A8->U+B8, U+B8, U+C0..U+DF->U+E0..U+FF, U+E0..U+FF 425 | # 426 | # 'utf-8' default value is 427 | # charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F 428 | 429 | 430 | # ignored characters list 431 | # optional, default value is empty 432 | # 433 | # ignore_chars = U+00AD 434 | 435 | 436 | # minimum word prefix length to index 437 | # optional, default is 0 (do not index prefixes) 438 | # 439 | min_prefix_len = 3 440 | 441 | 442 | # minimum word infix length to index 443 | # optional, default is 0 (do not index infixes) 444 | # 445 | #min_infix_len = 4 446 | 447 | 448 | # list of fields to limit prefix/infix indexing to 449 | # optional, default value is empty (index all fields in prefix/infix mode) 450 | # 451 | prefix_fields = title, content, feed_title, author 452 | # infix_fields = title, content, feed_title, author 453 | 454 | # enable star-syntax (wildcards) when searching prefix/infix indexes 455 | # search-time only, does not affect indexing, can be 0 or 1 456 | # optional, default is 0 (do not use wildcard syntax) 457 | # 458 | enable_star = 1 459 | 460 | # expand keywords with exact forms and/or stars when searching fit indexes 461 | # search-time only, does not affect indexing, can be 0 or 1 462 | # optional, default is 0 (do not expand keywords) 463 | # 464 | # expand_keywords = 1 465 | 466 | 467 | # n-gram length to index, for CJK indexing 468 | # only supports 0 and 1 for now, other lengths to be implemented 469 | # optional, default is 0 (disable n-grams) 470 | # 471 | # ngram_len = 1 472 | 473 | 474 | # n-gram characters list, for CJK indexing 475 | # optional, default is empty 476 | # 477 | # ngram_chars = U+3000..U+2FA1F 478 | 479 | 480 | # phrase boundary characters list 481 | # optional, default is empty 482 | # 483 | # phrase_boundary = ., ?, !, U+2026 # horizontal ellipsis 484 | 485 | 486 | # phrase boundary word position increment 487 | # optional, default is 0 488 | # 489 | # phrase_boundary_step = 100 490 | 491 | 492 | # blended characters list 493 | # blended chars are indexed both as separators and valid characters 494 | # for instance, AT&T will results in 3 tokens ("at", "t", and "at&t") 495 | # optional, default is empty 496 | # 497 | # blend_chars = +, &, U+23 498 | 499 | 500 | # blended token indexing mode 501 | # a comma separated list of blended token indexing variants 502 | # known variants are trim_none, trim_head, trim_tail, trim_both, skip_pure 503 | # optional, default is trim_none 504 | # 505 | # blend_mode = trim_tail, skip_pure 506 | 507 | 508 | # whether to strip HTML tags from incoming documents 509 | # known values are 0 (do not strip) and 1 (do strip) 510 | # optional, default is 0 511 | html_strip = 1 512 | 513 | # what HTML attributes to index if stripping HTML 514 | # optional, default is empty (do not index anything) 515 | # 516 | # html_index_attrs = img=alt,title; a=title; 517 | 518 | 519 | # what HTML elements contents to strip 520 | # optional, default is empty (do not strip element contents) 521 | # 522 | # html_remove_elements = style, script 523 | 524 | 525 | # whether to preopen index data files on startup 526 | # optional, default is 0 (do not preopen), searchd-only 527 | # 528 | # preopen = 1 529 | 530 | 531 | # whether to keep dictionary (.spi) on disk, or cache it in RAM 532 | # optional, default is 0 (cache in RAM), searchd-only 533 | # 534 | # ondisk_dict = 1 535 | 536 | 537 | # whether to enable in-place inversion (2x less disk, 90-95% speed) 538 | # optional, default is 0 (use separate temporary files), indexer-only 539 | # 540 | # inplace_enable = 1 541 | 542 | 543 | # in-place fine-tuning options 544 | # optional, defaults are listed below 545 | # 546 | # inplace_hit_gap = 0 # preallocated hitlist gap size 547 | # inplace_docinfo_gap = 0 # preallocated docinfo gap size 548 | # inplace_reloc_factor = 0.1 # relocation buffer size within arena 549 | # inplace_write_factor = 0.1 # write buffer size within arena 550 | 551 | 552 | # whether to index original keywords along with stemmed versions 553 | # enables "=exactform" operator to work 554 | # optional, default is 0 555 | # 556 | # index_exact_words = 1 557 | 558 | 559 | # position increment on overshort (less that min_word_len) words 560 | # optional, allowed values are 0 and 1, default is 1 561 | # 562 | # overshort_step = 1 563 | 564 | 565 | # position increment on stopword 566 | # optional, allowed values are 0 and 1, default is 1 567 | # 568 | # stopword_step = 1 569 | 570 | 571 | # hitless words list 572 | # positions for these keywords will not be stored in the index 573 | # optional, allowed values are 'all', or a list file name 574 | # 575 | # hitless_words = all 576 | # hitless_words = hitless.txt 577 | 578 | 579 | # detect and index sentence and paragraph boundaries 580 | # required for the SENTENCE and PARAGRAPH operators to work 581 | # optional, allowed values are 0 and 1, default is 0 582 | # 583 | # index_sp = 1 584 | 585 | 586 | # index zones, delimited by HTML/XML tags 587 | # a comma separated list of tags and wildcards 588 | # required for the ZONE operator to work 589 | # optional, default is empty string (do not index zones) 590 | # 591 | # index_zones = title, h*, th 592 | } 593 | 594 | index delta : ##OPENSHIFT_APP_NAME## { 595 | source = delta 596 | path = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/##OPENSHIFT_APP_NAME##_delta 597 | } 598 | 599 | # inherited index example 600 | # 601 | # all the parameters are copied from the parent index, 602 | # and may then be overridden in this index definition 603 | #index test1stemmed : test1 604 | #{ 605 | # path = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/test1stemmed 606 | # morphology = stem_en 607 | #} 608 | 609 | 610 | # distributed index example 611 | # 612 | # this is a virtual index which can NOT be directly indexed, 613 | # and only contains references to other local and/or remote indexes 614 | #index dist1 615 | #{ 616 | # # 'distributed' index type MUST be specified 617 | # type = distributed 618 | # 619 | # # local index to be searched 620 | # # there can be many local indexes configured 621 | # local = test1 622 | # local = test1stemmed 623 | # 624 | # # remote agent 625 | # # multiple remote agents may be specified 626 | # # syntax for TCP connections is 'hostname:port:index1,[index2[,...]]' 627 | # # syntax for local UNIX connections is '/path/to/socket:index1,[index2[,...]]' 628 | # agent = localhost:9313:remote1 629 | # agent = localhost:9314:remote2,remote3 630 | # # agent = /var/run/searchd.sock:remote4 631 | # 632 | # # blackhole remote agent, for debugging/testing 633 | # # network errors and search results will be ignored 634 | # # 635 | # # agent_blackhole = testbox:9312:testindex1,testindex2 636 | # 637 | # 638 | # # remote agent connection timeout, milliseconds 639 | # # optional, default is 1000 ms, ie. 1 sec 640 | # agent_connect_timeout = 1000 641 | # 642 | # # remote agent query timeout, milliseconds 643 | # # optional, default is 3000 ms, ie. 3 sec 644 | # agent_query_timeout = 3000 645 | #} 646 | 647 | 648 | # realtime index example 649 | # 650 | # you can run INSERT, REPLACE, and DELETE on this index on the fly 651 | # using MySQL protocol (see 'listen' directive below) 652 | #index rt 653 | #{ 654 | # # 'rt' index type must be specified to use RT index 655 | # type = rt 656 | # 657 | # # index files path and file name, without extension 658 | # # mandatory, path must be writable, extensions will be auto-appended 659 | # path = ##OPENSHIFT_DATA_DIR##/sphinx/var/data/rt 660 | # 661 | # # RAM chunk size limit 662 | # # RT index will keep at most this much data in RAM, then flush to disk 663 | # # optional, default is 32M 664 | # # 665 | # # rt_mem_limit = 512M 666 | # 667 | # # full-text field declaration 668 | # # multi-value, mandatory 669 | # rt_field = title 670 | # rt_field = content 671 | # 672 | # # unsigned integer attribute declaration 673 | # # multi-value (an arbitrary number of attributes is allowed), optional 674 | # # declares an unsigned 32-bit attribute 675 | # rt_attr_uint = gid 676 | # 677 | # # RT indexes currently support the following attribute types: 678 | # # uint, bigint, float, timestamp, string 679 | # # 680 | # # rt_attr_bigint = guid 681 | # # rt_attr_float = gpa 682 | # # rt_attr_timestamp = ts_added 683 | # # rt_attr_string = author 684 | #} 685 | 686 | ############################################################################# 687 | ## indexer settings 688 | ############################################################################# 689 | 690 | indexer 691 | { 692 | # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) 693 | # optional, default is 32M, max is 2047M, recommended is 256M to 1024M 694 | mem_limit = 32M 695 | 696 | # maximum IO calls per second (for I/O throttling) 697 | # optional, default is 0 (unlimited) 698 | # 699 | # max_iops = 40 700 | 701 | 702 | # maximum IO call size, bytes (for I/O throttling) 703 | # optional, default is 0 (unlimited) 704 | # 705 | # max_iosize = 1048576 706 | 707 | 708 | # maximum xmlpipe2 field length, bytes 709 | # optional, default is 2M 710 | # 711 | # max_xmlpipe2_field = 4M 712 | 713 | 714 | # write buffer size, bytes 715 | # several (currently up to 4) buffers will be allocated 716 | # write buffers are allocated in addition to mem_limit 717 | # optional, default is 1M 718 | # 719 | # write_buffer = 1M 720 | 721 | 722 | # maximum file field adaptive buffer size 723 | # optional, default is 8M, minimum is 1M 724 | # 725 | # max_file_field_buffer = 32M 726 | } 727 | 728 | ############################################################################# 729 | ## searchd settings 730 | ############################################################################# 731 | 732 | searchd 733 | { 734 | # [hostname:]port[:protocol], or /unix/socket/path to listen on 735 | # known protocols are 'sphinx' (SphinxAPI) and 'mysql41' (SphinxQL) 736 | # 737 | # multi-value, multiple listen points are allowed 738 | # optional, defaults are 9312:sphinx and 9306:mysql41, as below 739 | # 740 | # listen = 127.0.0.1 741 | # listen = 192.168.0.1:9312 742 | # listen = 9312 743 | # listen = /var/run/searchd.sock 744 | #listen = 9312 745 | #listen = 9306:mysql41 746 | listen = ##OPENSHIFT_PHP_IP##:15000 747 | #listen = ##OPENSHIFT_PHP_IP##:15001:mysql41 748 | 749 | # log file, searchd run info is logged here 750 | # optional, default is 'searchd.log' 751 | log = ##OPENSHIFT_PHP_LOG_DIR##/sphinx-searchd.log 752 | 753 | # query log file, all search queries are logged here 754 | # optional, default is empty (do not log queries) 755 | query_log = ##OPENSHIFT_PHP_LOG_DIR##/sphinx-query.log 756 | 757 | # client read timeout, seconds 758 | # optional, default is 5 759 | read_timeout = 5 760 | 761 | # request timeout, seconds 762 | # optional, default is 5 minutes 763 | client_timeout = 300 764 | 765 | # maximum amount of children to fork (concurrent searches to run) 766 | # optional, default is 0 (unlimited) 767 | max_children = 30 768 | 769 | # PID file, searchd process ID file name 770 | # mandatory 771 | pid_file = ##OPENSHIFT_DATA_DIR##/run/sphinx-searchd.pid 772 | 773 | # max amount of matches the daemon ever keeps in RAM, per-index 774 | # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL 775 | # default is 1000 (just like Google) 776 | max_matches = 1000 777 | 778 | # seamless rotate, prevents rotate stalls if precaching huge datasets 779 | # optional, default is 1 780 | seamless_rotate = 1 781 | 782 | # whether to forcibly preopen all indexes on startup 783 | # optional, default is 1 (preopen everything) 784 | preopen_indexes = 0 785 | 786 | # whether to unlink .old index copies on succesful rotation. 787 | # optional, default is 1 (do unlink) 788 | unlink_old = 1 789 | 790 | # attribute updates periodic flush timeout, seconds 791 | # updates will be automatically dumped to disk this frequently 792 | # optional, default is 0 (disable periodic flush) 793 | # 794 | # attr_flush_period = 900 795 | 796 | 797 | # instance-wide ondisk_dict defaults (per-index value take precedence) 798 | # optional, default is 0 (precache all dictionaries in RAM) 799 | # 800 | # ondisk_dict_default = 1 801 | 802 | 803 | # MVA updates pool size 804 | # shared between all instances of searchd, disables attr flushes! 805 | # optional, default size is 1M 806 | mva_updates_pool = 1M 807 | 808 | # max allowed network packet size 809 | # limits both query packets from clients, and responses from agents 810 | # optional, default size is 8M 811 | max_packet_size = 8M 812 | 813 | # crash log path 814 | # searchd will (try to) log crashed query to 'crash_log_path.PID' file 815 | # optional, default is empty (do not create crash logs) 816 | # 817 | # crash_log_path = ##OPENSHIFT_DATA_DIR##/sphinx/log/crash 818 | 819 | 820 | # max allowed per-query filter count 821 | # optional, default is 256 822 | max_filters = 256 823 | 824 | # max allowed per-filter values count 825 | # optional, default is 4096 826 | max_filter_values = 4096 827 | 828 | 829 | # socket listen queue length 830 | # optional, default is 5 831 | # 832 | # listen_backlog = 5 833 | 834 | 835 | # per-keyword read buffer size 836 | # optional, default is 256K 837 | # 838 | # read_buffer = 256K 839 | 840 | 841 | # unhinted read size (currently used when reading hits) 842 | # optional, default is 32K 843 | # 844 | # read_unhinted = 32K 845 | 846 | 847 | # max allowed per-batch query count (aka multi-query count) 848 | # optional, default is 32 849 | max_batch_queries = 32 850 | 851 | 852 | # max common subtree document cache size, per-query 853 | # optional, default is 0 (disable subtree optimization) 854 | # 855 | # subtree_docs_cache = 4M 856 | 857 | 858 | # max common subtree hit cache size, per-query 859 | # optional, default is 0 (disable subtree optimization) 860 | # 861 | # subtree_hits_cache = 8M 862 | 863 | 864 | # multi-processing mode (MPM) 865 | # known values are none, fork, prefork, and threads 866 | # optional, default is fork 867 | # 868 | workers = threads # for RT to work 869 | 870 | 871 | # max threads to create for searching local parts of a distributed index 872 | # optional, default is 0, which means disable multi-threaded searching 873 | # should work with all MPMs (ie. does NOT require workers=threads) 874 | # 875 | # dist_threads = 4 876 | 877 | 878 | # binlog files path; use empty string to disable binlog 879 | # optional, default is build-time configured data directory 880 | # 881 | # binlog_path = # disable logging 882 | binlog_path = ##OPENSHIFT_DATA_DIR##/sphinx/var/data # binlog.001 etc will be created there 883 | 884 | 885 | # binlog flush/sync mode 886 | # 0 means flush and sync every second 887 | # 1 means flush and sync every transaction 888 | # 2 means flush every transaction, sync every second 889 | # optional, default is 2 890 | # 891 | # binlog_flush = 2 892 | 893 | 894 | # binlog per-file size limit 895 | # optional, default is 128M, 0 means no limit 896 | # 897 | # binlog_max_log_size = 256M 898 | 899 | 900 | # per-thread stack size, only affects workers=threads mode 901 | # optional, default is 64K 902 | # 903 | # thread_stack = 128K 904 | 905 | 906 | # per-keyword expansion limit (for dict=keywords prefix searches) 907 | # optional, default is 0 (no limit) 908 | # 909 | # expansion_limit = 1000 910 | 911 | 912 | # RT RAM chunks flush period 913 | # optional, default is 0 (no periodic flush) 914 | # 915 | # rt_flush_period = 900 916 | 917 | 918 | # query log file format 919 | # optional, known values are plain and sphinxql, default is plain 920 | # 921 | # query_log_format = sphinxql 922 | 923 | 924 | # version string returned to MySQL network protocol clients 925 | # optional, default is empty (use Sphinx version) 926 | # 927 | # mysql_version_string = 5.0.37 928 | 929 | 930 | # trusted plugin directory 931 | # optional, default is empty (disable UDFs) 932 | # 933 | # plugin_dir = /usr/local/sphinx/lib 934 | 935 | 936 | # default server-wide collation 937 | # optional, default is libc_ci 938 | # 939 | # collation_server = utf8_general_ci 940 | 941 | 942 | # server-wide locale for libc based collations 943 | # optional, default is C 944 | # 945 | # collation_libc_locale = ru_RU.UTF-8 946 | 947 | 948 | # threaded server watchdog (only used in workers=threads mode) 949 | # optional, values are 0 and 1, default is 1 (watchdog on) 950 | # 951 | # watchdog = 1 952 | 953 | 954 | # SphinxQL compatibility mode (legacy columns and their names) 955 | # optional, default is 1 (old-style) 956 | # 957 | # compat_sphinxql_magics = 1 958 | } 959 | 960 | # --eof-- 961 | -------------------------------------------------------------------------------- /misc/sphinx.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # Based on the debian init.d script modified for openshift by 3 | # Michael Guntsche 4 | # 5 | # Written by Miquel van Smoorenburg . 6 | # Modified for Debian 7 | # by Ian Murdock . 8 | # Further changes by Javier Fernandez-Sanguino 9 | # Modified for sphinx by Radu Spineanu 10 | # 11 | # 12 | 13 | DAEMON=${OPENSHIFT_REPO_DIR}/sphinx/bin/searchd 14 | NAME=searchd 15 | DESC=sphinxsearch 16 | 17 | test -x $DAEMON || exit 0 18 | 19 | PIDFILE=${OPENSHIFT_DATA_DIR}/run/sphinx-searchd.pid 20 | DODTIME=1 # Time to wait for the server to die, in seconds 21 | # If this value is set too low you might not 22 | # let some servers to die gracefully and 23 | # 'restart' will not work 24 | 25 | STARTDELAY=0.5 26 | 27 | set -e 28 | 29 | running_pid() 30 | { 31 | # Check if a given process pid's cmdline matches a given name 32 | pid=$1 33 | name=$2 34 | [ -z "$pid" ] && return 1 35 | [ ! -d /proc/$pid ] && return 1 36 | cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` 37 | # Is this the expected child? 38 | [ "$cmd" != "$name" ] && return 1 39 | return 0 40 | } 41 | running() 42 | { 43 | # Check if the process is running looking at /proc 44 | # (works for all users) 45 | 46 | # No pidfile, probably no daemon present 47 | [ ! -f "$PIDFILE" ] && return 1 48 | # Obtain the pid and check it against the binary name 49 | pid=`cat $PIDFILE` 50 | running_pid $pid $DAEMON || return 1 51 | return 0 52 | } 53 | 54 | do_force_stop() { 55 | # Forcefully kill the process 56 | [ ! -f "$PIDFILE" ] && return 57 | if running ; then 58 | kill -15 $pid 59 | # Is it really dead? 60 | [ -n "$DODTIME" ] && sleep "$DODTIME"s 61 | if running ; then 62 | kill -9 $pid 63 | [ -n "$DODTIME" ] && sleep "$DODTIME"s 64 | if running ; then 65 | echo "Cannot kill $NAME (pid=$pid)!" 66 | exit 1 67 | fi 68 | fi 69 | fi 70 | rm -f $PIDFILE 71 | return 0 72 | } 73 | 74 | case "$1" in 75 | start) 76 | echo -n "Starting $DESC: " 77 | if ! running ; then 78 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/searchd --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf 79 | echo $NAME 80 | else 81 | echo "Already running" 82 | fi 83 | ;; 84 | stop) 85 | echo -n "Stopping $DESC: " 86 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/searchd --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf --stop 87 | echo "$NAME." 88 | ;; 89 | restart|reload|force-reload) 90 | echo -n "Restarting $DESC: " 91 | 92 | if running ; then 93 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/searchd --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf --stop 94 | fi 95 | [ -n "$DODTIME" ] && sleep $DODTIME 96 | ${OPENSHIFT_REPO_DIR}/sphinx/bin/searchd --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf 97 | echo "$NAME." 98 | ;; 99 | 100 | force-stop) 101 | echo -n "Forcefully stopping $DESC: " 102 | do_force_stop 103 | if ! running ; then 104 | echo "$NAME." 105 | else 106 | echo "ERROR." 107 | fi 108 | ;; 109 | status) 110 | echo -n "$NAME is " 111 | if running ; then 112 | echo "running" 113 | else 114 | echo "not running." 115 | exit 1 116 | fi 117 | ;; 118 | *) 119 | N=$NAME 120 | # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 121 | echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2 122 | exit 1 123 | 124 | esac 125 | 126 | exit 0 127 | -------------------------------------------------------------------------------- /sphinx/bin/indexer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/sphinx/bin/indexer -------------------------------------------------------------------------------- /sphinx/bin/indextool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/sphinx/bin/indextool -------------------------------------------------------------------------------- /sphinx/bin/search: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/sphinx/bin/search -------------------------------------------------------------------------------- /sphinx/bin/searchd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/sphinx/bin/searchd -------------------------------------------------------------------------------- /sphinx/bin/spelldump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/disconn3ct/tiny_tiny_rss-openshift-quickstart/5b088206a0d5df2b132a33a83bab0290a91fef70/sphinx/bin/spelldump -------------------------------------------------------------------------------- /sphinx/share/man/man1/indexer.1: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Title: indexer 3 | .\" Author: [see the "Author" section] 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 5 | .\" Date: 03/26/2013 6 | .\" Manual: Sphinxsearch 7 | .\" Source: 2.0.7-release 8 | .\" Language: English 9 | .\" 10 | .TH "INDEXER" "1" "03/26/2013" "2\&.0\&.7\-release" "Sphinxsearch" 11 | .\" ----------------------------------------------------------------- 12 | .\" * Define some portability stuff 13 | .\" ----------------------------------------------------------------- 14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | .\" http://bugs.debian.org/507673 16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html 17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .ie \n(.g .ds Aq \(aq 19 | .el .ds Aq ' 20 | .\" ----------------------------------------------------------------- 21 | .\" * set default formatting 22 | .\" ----------------------------------------------------------------- 23 | .\" disable hyphenation 24 | .nh 25 | .\" disable justification (adjust text to left margin only) 26 | .ad l 27 | .\" ----------------------------------------------------------------- 28 | .\" * MAIN CONTENT STARTS HERE * 29 | .\" ----------------------------------------------------------------- 30 | .SH "NAME" 31 | indexer \- Sphinxsearch fulltext index generator 32 | .SH "SYNOPSIS" 33 | .HP \w'\fBindexer\fR\ 'u 34 | \fBindexer\fR [\-\-config\ \fICONFIGFILE\fR] [\-\-rotate] [\-\-noprogress | \-\-quiet] [\-\-all | \fIINDEX\fR | \fI\&.\&.\&.\fR] 35 | .HP \w'\fBindexer\fR\ 'u 36 | \fBindexer\fR \-\-buildstops\ \fIOUTPUTFILE\fR \fICOUNT\fR [\-\-config\ \fICONFIGFILE\fR] [\-\-noprogress | \-\-quiet] [\-\-all | \fIINDEX\fR | \fI\&.\&.\&.\fR] 37 | .HP \w'\fBindexer\fR\ 'u 38 | \fBindexer\fR \-\-merge\ \fIMAIN_INDEX\fR \fIDELTA_INDEX\fR [\-\-config\ \fICONFIGFILE\fR] [\-\-rotate] [\-\-noprogress | \-\-quiet] 39 | .SH "DESCRIPTION" 40 | .PP 41 | Sphinx is a collection of programs that aim to provide high quality fulltext search\&. 42 | .PP 43 | \fBindexer\fR 44 | is the first of the two principle tools as part of Sphinx\&. Invoked from either the command line directly, or as part of a larger script, 45 | \fBindexer\fR 46 | is solely responsible for gathering the data that will be searchable\&. 47 | .PP 48 | The calling syntax for indexer is as follows: 49 | .sp 50 | .if n \{\ 51 | .RS 4 52 | .\} 53 | .nf 54 | $ indexer [OPTIONS] [indexname1 [indexname2 [\&.\&.\&.]]] 55 | .fi 56 | .if n \{\ 57 | .RE 58 | .\} 59 | .PP 60 | Essentially you would list the different possible indexes (that you would later make available to search) in 61 | sphinx\&.conf, so when calling 62 | \fBindexer\fR, as a minimum you need to be telling it what index (or indexes) you want to index\&. 63 | .PP 64 | If 65 | sphinx\&.conf 66 | contained details on 2 indexes, 67 | \fImybigindex\fR 68 | and 69 | \fImysmallindex\fR, you could do the following: 70 | .sp 71 | .if n \{\ 72 | .RS 4 73 | .\} 74 | .nf 75 | $ indexer mybigindex 76 | $ indexer mysmallindex mybigindex 77 | .fi 78 | .if n \{\ 79 | .RE 80 | .\} 81 | .PP 82 | As part of the configuration file, 83 | sphinx\&.conf, you specify one or more indexes for your data\&. You might call 84 | \fBindexer\fR 85 | to reindex one of them, ad\-hoc, or you can tell it to process all indexes \- you are not limited to calling just one, or all at once, you can always pick some combination of the available indexes\&. 86 | .SH "OPTIONS" 87 | .PP 88 | The majority of the options for 89 | \fBindexer\fR 90 | are given in the configuration file, however there are some options you might need to specify on the command line as well, as they can affect how the indexing operation is performed\&. These options are: 91 | .PP 92 | \fB\-\-all\fR 93 | .RS 4 94 | Tells 95 | \fBindexer\fR 96 | to update every index listed in 97 | sphinx\&.conf, instead of listing individual indexes\&. This would be useful in small configurations, or cron\-type or maintenance jobs where the entire index set will get rebuilt each day, or week, or whatever period is best\&. 98 | .sp 99 | Example usage: 100 | .sp 101 | .if n \{\ 102 | .RS 4 103 | .\} 104 | .nf 105 | $ indexer \-\-config /home/myuser/sphinx\&.conf \-\-all 106 | .fi 107 | .if n \{\ 108 | .RE 109 | .\} 110 | .RE 111 | .PP 112 | \fB\-\-buildstops\fR \fIoutfile\&.txt\fR \fINUM\fR 113 | .RS 4 114 | Reviews the index source, as if it were indexing the data, and produces a list of the terms that are being indexed\&. In other words, it produces a list of all the searchable terms that are becoming part of the index\&. Note; it does not update the index in question, it simply processes the data \*(Aqas if\*(Aq it were indexing, including running queries defined with 115 | \fIsql_query_pre\fR 116 | or 117 | \fIsql_query_post\fR\&. 118 | outputfile\&.txt 119 | will contain the list of words, one per line, sorted by frequency with most frequent first, and 120 | \fINUM\fR 121 | specifies the maximum number of words that will be listed; if sufficiently large to encompass every word in the index, only that many words will be returned\&. Such a dictionary list could be used for client application features around "Did you mean\&.\&.\&." functionality, usually in conjunction with 122 | \fB\-\-buildfreqs\fR, below\&. 123 | .sp 124 | Example: 125 | .sp 126 | .if n \{\ 127 | .RS 4 128 | .\} 129 | .nf 130 | $ indexer myindex \-\-buildstops word_freq\&.txt 1000 131 | .fi 132 | .if n \{\ 133 | .RE 134 | .\} 135 | .sp 136 | This would produce a document in the current directory, 137 | word_freq\&.txt 138 | with the 1,000 most common words in \*(Aqmyindex\*(Aq, ordered by most common first\&. Note that the file will pertain to the last index indexed when specified with multiple indexes or 139 | \fB\-\-all\fR 140 | (i\&.e\&. the last one listed in the configuration file) 141 | .RE 142 | .PP 143 | \fB\-\-buildfreqs\fR 144 | .RS 4 145 | Used in pair with 146 | \fB\-\-buildstops\fR 147 | (and is ignored if 148 | \fB\-\-buildstops\fR 149 | is not specified)\&. As 150 | \fB\-\-buildstops\fR 151 | provides the list of words used within the index, 152 | \fB\-\-buildfreqs\fR 153 | adds the quantity present in the index, which would be useful in establishing whether certain words should be considered stopwords if they are too prevalent\&. It will also help with developing "Did you mean\&.\&.\&." features where you can how much more common a given word compared to another, similar one\&. 154 | .sp 155 | Example: 156 | .sp 157 | .if n \{\ 158 | .RS 4 159 | .\} 160 | .nf 161 | $ indexer myindex \-\-buildstops word_freq\&.txt 1000 \-\-buildfreqs 162 | .fi 163 | .if n \{\ 164 | .RE 165 | .\} 166 | .sp 167 | This would produce the 168 | word_freq\&.txt 169 | as above, however after each word would be the number of times it occurred in the index in question\&. 170 | .RE 171 | .PP 172 | \fB\-\-config\fR\ \&\fICONFIGRILE\fR, \fB\-c\fR\ \&\fICONFIGFILE\fR 173 | .RS 4 174 | Use the given file as configuration\&. Normally, it will look for 175 | sphinx\&.conf 176 | in the installation directory (e\&.g\&./usr/local/sphinx/etc/sphinx\&.conf 177 | if installed into 178 | /usr/local/sphinx), followed by the current directory you are in when calling indexer from the shell\&. This is most of use in shared environments where the binary files are installed somewhere like 179 | /usr/local/sphinx/ 180 | but you want to provide users with the ability to make their own custom Sphinx set\-ups, or if you want to run multiple instances on a single server\&. In cases like those you could allow them to create their own 181 | sphinx\&.conf 182 | files and pass them to 183 | \fBindexer\fR 184 | with this option\&. 185 | .sp 186 | For example: 187 | .sp 188 | .if n \{\ 189 | .RS 4 190 | .\} 191 | .nf 192 | $ indexer \-\-config /home/myuser/sphinx\&.conf myindex 193 | .fi 194 | .if n \{\ 195 | .RE 196 | .\} 197 | .RE 198 | .PP 199 | \fB\-\-dump\-rows\fR \fIFILE\fR 200 | .RS 4 201 | Dumps rows fetched by SQL source(s) into the specified file, in a MySQL compatible syntax\&. Resulting dumps are the exact representation of data as received by indexer and help to repeat indexing\-time issues\&. 202 | .RE 203 | .PP 204 | \fB\-\-merge\fR \fIDST\-INDEX\fR \fISRC\-INDEX\fR 205 | .RS 4 206 | Physically merge together two indexes\&. For example if you have a main+delta scheme, where the main index rarely changes, but the delta index is rebuilt frequently, and 207 | \fB\-\-merge\fR 208 | would be used to combine the two\&. The operation moves from right to left \- the contents of 209 | \fISRC\-INDEX\fR 210 | get examined and physically combined with the contents of 211 | \fIDST\-INDEX\fR 212 | and the result is left in 213 | \fIDST\-INDEX\fR\&. In pseudo\-code, it might be expressed as: 214 | \fIDST\-INDEX\fR 215 | += 216 | \fISRC\-INDEX\fR 217 | .sp 218 | An example: 219 | .sp 220 | .if n \{\ 221 | .RS 4 222 | .\} 223 | .nf 224 | $ indexer \-\-merge main delta \-\-rotate 225 | .fi 226 | .if n \{\ 227 | .RE 228 | .\} 229 | .sp 230 | In the above example, where the main is the master, rarely modified index, and delta is the less frequently modified one, you might use the above to call 231 | \fBindexer\fR 232 | to combine the contents of the delta into the main index and rotate the indexes\&. 233 | .RE 234 | .PP 235 | \fB\-\-merge\-dst\-range\fR \fIATTR\fR \fIMIN\fR \fIMAX\fR 236 | .RS 4 237 | Run the filter range given upon merging\&. Specifically, as the merge is applied to the destination index (as part of 238 | \fB\-\-merge\fR, and is ignored if 239 | \fB\-\-merge\fR 240 | is not specified), 241 | \fBindexer\fR 242 | will also filter the documents ending up in the destination index, and only documents will pass through the filter given will end up in the final index\&. This could be used for example, in an index where there is a \*(Aqdeleted\*(Aq attribute, where 0 means \*(Aqnot deleted\*(Aq\&. Such an index could be merged with: 243 | .sp 244 | .if n \{\ 245 | .RS 4 246 | .\} 247 | .nf 248 | $ indexer \-\-merge main delta \-\-merge\-dst\-range deleted 0 0 249 | .fi 250 | .if n \{\ 251 | .RE 252 | .\} 253 | .sp 254 | Any documents marked as deleted (value 1) would be removed from the newly\-merged destination index\&. It can be added several times to the command line, to add successive filters to the merge, all of which must be met in order for a document to become part of the final index\&. 255 | .RE 256 | .PP 257 | \fB\-\-merge\-killlists\fR, \fB\-\-merge\-klists\fR 258 | .RS 4 259 | Used in pair with 260 | \fB\-\-merge\fR\&. Usually when merging 261 | \fBindexer\fR 262 | uses kill\-list of source index (i\&.e\&., the one which is merged into) as the filter to wipe out the matching docs from the destination index\&. At the same time the kill\-list of the destination itself isn\*(Aqt touched at all\&. When using 263 | \fB\-\-merge\-killlists\fR, (or it shorter form 264 | \fB\-\-merge\-klists\fR) the 265 | \fBindexer\fR 266 | will not filter the dst\-index docs with src\-index killlist, but it will merge their kill\-lists together, so the final result index will have the kill\-list containing the merged source kill\-lists\&. 267 | .RE 268 | .PP 269 | \fB\-\-noprogress\fR 270 | .RS 4 271 | Don\*(Aqt display progress details as they occur; instead, the final status details (such as documents indexed, speed of indexing and so on are only reported at completion of indexing\&. In instances where the script is not being run on a console (or \*(Aqtty\*(Aq), this will be on by default\&. 272 | .sp 273 | Example usage: 274 | .sp 275 | .if n \{\ 276 | .RS 4 277 | .\} 278 | .nf 279 | $ indexer \-\-rotate \-\-all \-\-noprogress 280 | .fi 281 | .if n \{\ 282 | .RE 283 | .\} 284 | .RE 285 | .PP 286 | \fB\-\-print\-queries\fR 287 | .RS 4 288 | Prints out SQL queries that indexer sends to the database, along with SQL connection and disconnection events\&. That is useful to diagnose and fix problems with SQL sources\&. 289 | .RE 290 | .PP 291 | \fB\-\-quiet\fR 292 | .RS 4 293 | Tells 294 | \fBindexer\fR 295 | not to output anything, unless there is an error\&. Again, most used for cron\-type, or other script jobs where the output is irrelevant or unnecessary, except in the event of some kind of error\&. 296 | .sp 297 | Example usage: 298 | .sp 299 | .if n \{\ 300 | .RS 4 301 | .\} 302 | .nf 303 | $ indexer \-\-rotate \-\-all \-\-quiet 304 | .fi 305 | .if n \{\ 306 | .RE 307 | .\} 308 | .RE 309 | .PP 310 | \fB\-\-rotate\fR 311 | .RS 4 312 | Used for rotating indexes\&. Unless you have the situation where you can take the search function offline without troubling users, you will almost certainly need to keep search running whilst indexing new documents\&. 313 | \fB\-\-rotate\fR 314 | creates a second index, parallel to the first (in the same place, simply including 315 | \&.new 316 | in the filenames)\&. Once complete, 317 | \fBindexer\fR 318 | notifies 319 | \fBsearchd\fR 320 | via sending the 321 | \fISIGHUP\fR 322 | signal, and 323 | \fBsearchd\fR 324 | will attempt to rename the indexes (renaming the existing ones to include 325 | \&.old 326 | and renaming the 327 | \&.new 328 | to replace them), and then start serving from the newer files\&. Depending on the setting of 329 | \fBseamless_rotate\fR, there may be a slight delay in being able to search the newer indexes\&. 330 | .sp 331 | Example usage: 332 | .sp 333 | .if n \{\ 334 | .RS 4 335 | .\} 336 | .nf 337 | $ indexer \-\-rotate \-\-all 338 | .fi 339 | .if n \{\ 340 | .RE 341 | .\} 342 | .RE 343 | .PP 344 | \fB\-\-sighup\-each\fR 345 | .RS 4 346 | is useful when you are rebuilding many big indexes, and want each one rotated into 347 | \fBsearchd\fR 348 | as soon as possible\&. With 349 | \fB\-\-sighup\-each\fR, 350 | \fBindexer\fR 351 | will send a 352 | \fISIGHUP\fR 353 | signal to 354 | \fBsearchd\fR 355 | after succesfully completing the work on each index\&. (The default behavior is to send a single 356 | \fISIGHUP\fR 357 | after all the indexes were built\&.) 358 | .RE 359 | .PP 360 | \fB\-\-verbose\fR 361 | .RS 4 362 | Guarantees that every row that caused problems indexing (duplicate, zero, or missing document ID; or file field IO issues; etc) will be reported\&. By default, this option is off, and problem summaries may be reported instead\&. 363 | .RE 364 | .SH "AUTHOR" 365 | .PP 366 | Andrey Aksenoff (shodan@sphinxsearch\&.com)\&. This manual page is written by Alexey Vinogradov (klirichek@sphinxsearch\&.com), using the one written by Christian Hofstaedtler ch+debian\-packages@zeha\&.at for the 367 | \fBDebian\fR 368 | system (but may be used by others)\&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&. 369 | .PP 370 | On Debian systems, the complete text of the GNU General Public License can be found in 371 | /usr/share/common\-licenses/GPL\&. 372 | .SH "SEE ALSO" 373 | .PP 374 | \fBsearchd\fR(1), 375 | \fBsearch\fR(1), 376 | \fBindextool\fR(1), 377 | \fBspelldump\fR(1) 378 | .PP 379 | Sphinx and it\*(Aqs programs are documented fully by the 380 | \fISphinx reference manual\fR 381 | available in 382 | /usr/share/doc/sphinxsearch\&. 383 | -------------------------------------------------------------------------------- /sphinx/share/man/man1/indextool.1: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Title: indextool 3 | .\" Author: [see the "Author" section] 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 5 | .\" Date: 03/26/2013 6 | .\" Manual: Sphinxsearch 7 | .\" Source: 2.0.7-release 8 | .\" Language: English 9 | .\" 10 | .TH "INDEXTOOL" "1" "03/26/2013" "2\&.0\&.7\-release" "Sphinxsearch" 11 | .\" ----------------------------------------------------------------- 12 | .\" * Define some portability stuff 13 | .\" ----------------------------------------------------------------- 14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | .\" http://bugs.debian.org/507673 16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html 17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .ie \n(.g .ds Aq \(aq 19 | .el .ds Aq ' 20 | .\" ----------------------------------------------------------------- 21 | .\" * set default formatting 22 | .\" ----------------------------------------------------------------- 23 | .\" disable hyphenation 24 | .nh 25 | .\" disable justification (adjust text to left margin only) 26 | .ad l 27 | .\" ----------------------------------------------------------------- 28 | .\" * MAIN CONTENT STARTS HERE * 29 | .\" ----------------------------------------------------------------- 30 | .SH "NAME" 31 | indextool \- Sphinxsearch tool dump miscellaneous debug information about the physical index\&. 32 | .SH "SYNOPSIS" 33 | .HP \w'\fBindextool\fR\ 'u 34 | \fBindextool\fR {command} [options] 35 | .SH "DESCRIPTION" 36 | .PP 37 | Sphinx is a collection of programs that aim to provide high quality fulltext search\&. 38 | .PP 39 | \fBindextool\fR 40 | is one of the helper tools within the Sphinx package\&. It is used to dump miscellaneous debug information about the physical index\&. Apart ghe dumping 41 | \fBindextool\fR 42 | can perform index verification, hence the indextool name rather than just indexdump\&. 43 | .SH "COMMANDS" 44 | .PP 45 | The commands are as follows: 46 | .PP 47 | \fB\-\-dumpheader\fR \fIFILENAME\&.sph\fR 48 | .RS 4 49 | quickly dumps the provided index header file without touching any other index files or even the configuration file\&. The report provides a breakdown of all the index settings, in particular the entire attribute and field list\&. Prior to 0\&.9\&.9\-rc2, this command was present in CLI search utility\&. 50 | .RE 51 | .PP 52 | \fB\-\-dumpconfig\fR \fIFILENAME\&.sph\fR 53 | .RS 4 54 | dumps the index definition from the given index header file in (almost) compliant 55 | sphinx\&.conf 56 | file format\&. 57 | .RE 58 | .PP 59 | \fB\-\-dumpheader\fR \fIINDEXNAME\fR 60 | .RS 4 61 | dumps index header by index name with looking up the header path in the configuration file\&. 62 | .RE 63 | .PP 64 | \fB\-\-dumpdocids\fR \fIINDEXNAME\fR 65 | .RS 4 66 | dumps document IDs by index name\&. It takes the data from attribute (\&.spa) file and therefore requires 67 | \fBdocinfo=extern\fR 68 | to work\&. 69 | .RE 70 | .PP 71 | \fB\-\-dumphitlist\fR \fIINDEXNAME\fR \fIKEYWORD\fR 72 | .RS 4 73 | dumps all the hits (occurences) of a given keyword in a given index, with keyword specified as text\&. 74 | .RE 75 | .PP 76 | \fB\-\-dumphitlist\fR \fIINDEXNAME\fR \fB\-\-wordid\fR \fIID\fR 77 | .RS 4 78 | dumps all the hits (occurences) of a given keyword in a given index, with keyword specified as internal numeric ID\&. 79 | .RE 80 | .PP 81 | \fB\-\-htmlstrip\fR INDEXNAME 82 | .RS 4 83 | filters stdin using HTML stripper settings for a given index, and prints the filtering results to stdout\&. Note that the settings will be taken from 84 | sphinx\&.conf, and not the index header\&. 85 | .RE 86 | .PP 87 | \fB\-\-check\fR \fIINDEXNAME\fR 88 | .RS 4 89 | checks the index data files for consistency errors that might be introduced either by bugs in 90 | \fBindexer\fR 91 | and/or hardware faults\&. 92 | .RE 93 | .PP 94 | \fB\-\-strip\-path\fR 95 | .RS 4 96 | strips the path names from all the file names referenced from the index (stopwords, wordforms, exceptions, etc)\&. This is useful for checking indexes built on another machine with possibly different path layouts\&. 97 | .RE 98 | .PP 99 | \fB\-\-optimize\-rt\-klists\fR 100 | .RS 4 101 | optimizes the kill list memory use in the disk chunk of a given RT index\&. That is a one\-off optimization intended for rather old RT indexes, created by development versions prior to 1\&.10\-beta release\&. As of 1\&.10\-beta releases, this kill list optimization (purging) should happen automatically, and there should never be a need to use this option\&. 102 | .RE 103 | .SH "OPTIONS" 104 | .PP 105 | The only currently available option applies to all commands and lets you specify the configuration file: 106 | .PP 107 | \fB\-\-config\fR\ \&\fICONFIGFILE\fR, \fB\-c\fR\ \&\fICONFIGFILE\fR 108 | .RS 4 109 | overrides the built\-in config file names\&. 110 | .RE 111 | .SH "AUTHOR" 112 | .PP 113 | Andrey Aksenoff (shodan@sphinxsearch\&.com)\&. This manual page is written by Alexey Vinogradov (klirichek@sphinxsearch\&.com)\&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&. 114 | .PP 115 | On Debian systems, the complete text of the GNU General Public License can be found in 116 | /usr/share/common\-licenses/GPL\&. 117 | .SH "SEE ALSO" 118 | .PP 119 | \fBindexer\fR(1), 120 | \fBsearchd\fR(1), 121 | \fBsearch\fR(1) 122 | .PP 123 | Sphinx and it\*(Aqs programs are documented fully by the 124 | \fISphinx reference manual\fR 125 | available in 126 | /usr/share/doc/sphinxsearch\&. 127 | -------------------------------------------------------------------------------- /sphinx/share/man/man1/search.1: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Title: search 3 | .\" Author: [see the "Author" section] 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 5 | .\" Date: 03/26/2013 6 | .\" Manual: Sphinxsearch 7 | .\" Source: 2.0.7-release 8 | .\" Language: English 9 | .\" 10 | .TH "SEARCH" "1" "03/26/2013" "2\&.0\&.7\-release" "Sphinxsearch" 11 | .\" ----------------------------------------------------------------- 12 | .\" * Define some portability stuff 13 | .\" ----------------------------------------------------------------- 14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | .\" http://bugs.debian.org/507673 16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html 17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .ie \n(.g .ds Aq \(aq 19 | .el .ds Aq ' 20 | .\" ----------------------------------------------------------------- 21 | .\" * set default formatting 22 | .\" ----------------------------------------------------------------- 23 | .\" disable hyphenation 24 | .nh 25 | .\" disable justification (adjust text to left margin only) 26 | .ad l 27 | .\" ----------------------------------------------------------------- 28 | .\" * MAIN CONTENT STARTS HERE * 29 | .\" ----------------------------------------------------------------- 30 | .SH "NAME" 31 | search \- Sphinxsearch command\-line index query 32 | .SH "SYNOPSIS" 33 | .HP \w'\fBsearch\fR\ 'u 34 | \fBsearch\fR [OPTIONS] word1 [word2\ [word3\ [\&.\&.\&.]] ] 35 | .SH "DESCRIPTION" 36 | .PP 37 | Sphinx is a collection of programs that aim to provide high quality fulltext search\&. 38 | .PP 39 | \fBsearch\fR 40 | is one of the helper tools within the Sphinx package\&. Whereas 41 | \fBsearchd\fR 42 | is responsible for searches in a server\-type environment, 43 | \fBsearch\fR 44 | is aimed at testing the index from the command line, and testing the index quickly without building a framework to make the connection to the server and process its response\&. 45 | .PP 46 | Note: 47 | \fBsearch\fR 48 | is not intended to be deployed as part of a client application; it is strongly recommended you do not write an interface to 49 | \fBsearch\fR 50 | instead of 51 | \fBsearchd\fR, and none of the bundled client APIs support this method\&. (In any event, 52 | \fBsearch\fR 53 | will reload files each time, whereas 54 | \fBsearchd\fR 55 | will cache them in memory for performance\&.) 56 | .PP 57 | That said, many types of query that you could build in the APIs could also be made with 58 | \fBsearch\fR, however for very complex searches it may be easier to construct them using a small script and the corresponding API\&. Additionally, some newer features may be available in the 59 | \fBsearchd\fR 60 | system that have not yet been brought into 61 | \fBsearch\fR\&. 62 | .PP 63 | When calling 64 | \fBsearch\fR, it is not necessary to have 65 | \fBsearchd\fR 66 | running; simply make sure that the account running the 67 | \fBsearch\fR 68 | program has read access to the configuration file and the index files\&. 69 | .PP 70 | The default behaviour is to apply a 71 | \fBsearch\fR 72 | for 73 | \fIword1\fR 74 | (AND 75 | \fIword2\fR 76 | AND 77 | \fIword3\fR\&.\&.\&. as specified) to all fields in all indexes as given in the configuration file\&. If constructing the equivalent in the API, this would be the equivalent to passing 78 | \fBSPH_MATCH_ALL\fR 79 | to 80 | \fBSetMatchMode\fR, and specifying * as the indexes to query as part of Query\&. 81 | .SH "OPTIONS" 82 | .PP 83 | There are many options available to 84 | \fBsearch\fR\&. 85 | .PP 86 | Firstly, the general options: 87 | .PP 88 | \fB\-\-config\fR\ \&\fICONFIGFILE\fR, \fB\-c\fR\ \&\fICONFIGFILE\fR 89 | .RS 4 90 | Use the given file as its configuration, just as with 91 | \fBindexer\fR\&. 92 | .RE 93 | .PP 94 | \fB\-\-index\fR\ \&\fIINDEX\fR, \fB\-i\fR\ \&\fIINDEX\fR 95 | .RS 4 96 | Limit searching to the specified index only; normally 97 | \fBsearch\fR 98 | would attempt to search all of the physical indexes listed in 99 | sphinx\&.conf, not any distributed ones\&. 100 | .RE 101 | .PP 102 | \fB\-\-stdin\fR 103 | .RS 4 104 | Accept the query from the standard input, rather than the command line\&. This can be useful for testing purposes whereby you could feed input via pipes and from scripts 105 | .RE 106 | .PP 107 | Options for setting matches: 108 | .PP 109 | \fB\-\-any\fR, \fB\-a\fR 110 | .RS 4 111 | Changes the matching mode to match any of the words as part of the query (word1 OR word2 OR word3)\&. In the API this would be equivalent to passing 112 | \fBSPH_MATCH_ANY\fR 113 | to 114 | \fBSetMatchMode\fR\&. 115 | .RE 116 | .PP 117 | \fB\-\-phrase\fR, \fB\-p\fR 118 | .RS 4 119 | Changes the matching mode to match all of the words as part of the query, and do so in the phrase given (not including punctuation)\&. In the API this would be equivalent to passing 120 | \fBSPH_MATCH_PHRASE\fR 121 | to 122 | \fBSetMatchMode\fR\&. 123 | .RE 124 | .PP 125 | \fB\-\-boolean\fR, \fB\-b\fR 126 | .RS 4 127 | Changes the matching mode to 128 | \fIBoolean matching\fR\&. Note if using Boolean syntax matching on the command line, you may need to escape the symbols (with a backslash) to avoid the shell/command line processor applying them, such as ampersands being escaped on a Unix/Linux system to avoid it forking to the 129 | \fBsearch\fR 130 | process, although this can be resolved by using 131 | \fB\-\-stdin\fR, as below\&. In the API this would be equivalent to passing 132 | \fBSPH_MATCH_BOOLEAN\fR 133 | to 134 | \fBSetMatchMode\fR\&. 135 | .RE 136 | .PP 137 | \fB\-\-ext\fR, \fB\-e\fR 138 | .RS 4 139 | Changes the matching mode to 140 | \fIExtended matching\fR\&. In the API this would be equivalent to passing 141 | \fBSPH_MATCH_EXTENDED\fR 142 | to 143 | \fBSetMatchMode\fR, and it should be noted that use of this mode is being discouraged in favour of Extended2, below\&. 144 | .RE 145 | .PP 146 | \fB\-\-ext2\fR, \fB\-e2\fR 147 | .RS 4 148 | Changes the matching mode to 149 | \fIExtended matching, version 2\fR\&. In the API this would be equivalent to passing 150 | \fBSPH_MATCH_EXTENDED2\fR 151 | to 152 | \fBSetMatchMode\fR, and it should be noted that use of this mode is being recommended in favour of Extended, due to being more efficient and providing other features\&. 153 | .RE 154 | .PP 155 | \fB\-\-filter\fR\ \&\fI\fR\fI\fR, \fB\-f\fR\ \&\fI\fR\fI\fR 156 | .RS 4 157 | Filters the results such that only documents where the attribute given (attr) matches the value given (v)\&. For example, 158 | \fB\-\-filter\fR 159 | \fIdeleted\fR 160 | \fI0\fR 161 | only matches documents with an attribute called \*(Aqdeleted\*(Aq where its value is 0\&. You can also add multiple filters on the command line, by specifying multiple 162 | \fB\-\-filter\fR 163 | multiple times, however if you apply a second filter to an attribute it will override the first defined filter\&. 164 | .RE 165 | .PP 166 | Options for handling the results: 167 | .PP 168 | \fB\-\-limit\fR\ \&\fI\fR, \fB\-l\fR\ \&\fI\fR 169 | .RS 4 170 | limits the total number of matches back to the number given\&. If a \*(Aqgroup\*(Aq is specified, this will be the number of grouped results\&. This defaults to 20 results if not specified (as do the APIs) 171 | .RE 172 | .PP 173 | \fB\-\-offset\fR\ \&\fI\fR, \fB\-o\fR\ \&\fI\fR 174 | .RS 4 175 | offsets the result list by the number of places set by the count; this would be used for pagination through results, where if you have 20 results per \*(Aqpage\*(Aq, the second page would begin at offset 20, the third page at offset 40, etc\&. 176 | .RE 177 | .PP 178 | \fB\-\-group\fR\ \&\fI\fR, \fB\-g\fR\ \&\fI\fR 179 | .RS 4 180 | specifies that results should be grouped together based on the attribute specified\&. Like the GROUP BY clause in SQL, it will combine all results where the attribute given matches, and returns a set of results where each returned result is the best from each group\&. Unless otherwise specified, this will be the best match on relevance\&. 181 | .RE 182 | .PP 183 | \fB\-\-groupsort\fR\ \&\fI\fR, \fB\-gs\fR\ \&\fI\fR 184 | .RS 4 185 | instructs that when results are grouped with 186 | \fB\-\-group\fR, the expression given in 187 | \fI\fR 188 | shall determine the order of the groups\&. Note, this does not specify which is the best item within the group, only the order in which the groups themselves shall be returned\&. 189 | .RE 190 | .PP 191 | \fB\-\-sortby\fR\ \&\fI\fR, \fB\-s\fR\ \&\fI\fR 192 | .RS 4 193 | specifies that results should be sorted in the order listed in 194 | \fI\fR\&. This allows you to specify the order you wish results to be presented in, ordering by different columns\&. For example, you could say 195 | \fB\-\-sortby\fR 196 | \fI"@weight DESC entrytime DESC"\fR 197 | to sort entries first by weight (or relevance) and where two or more entries have the same weight, to then sort by the time with the highest time (newest) first\&. You will usually need to put the items in quotes (\fB\-\-sortby\fR 198 | \fI"@weight DESC"\fR) or use commas (\fB\-\-sortby\fR 199 | \fI@weight,DESC\fR) to avoid the items being treated separately\&. Additionally, like the regular sorting modes, if 200 | \fB\-\-group\fR 201 | (grouping) is being used, this will state how to establish the best match within each group\&. 202 | .RE 203 | .PP 204 | \fB\-\-sortexpr\fR\ \&\fI\fR, \fB\-S\fR\ \&\fI\fR 205 | .RS 4 206 | specifies that the search results should be presented in an order determined by an arithmetic expression, stated in expr\&. For example: 207 | \fB\-\-sortexpr\fR 208 | \fI"@weight + ( user_karma + ln(pageviews) )*0\&.1"\fR 209 | (again noting that this will have to be quoted to avoid the shell dealing with the asterisk)\&. Extended sort mode is discussed in more detail under the 210 | \fBSPH_SORT_EXTENDED\fR 211 | entry under the 212 | \fISorting modes\fR 213 | section of the manual\&. 214 | .RE 215 | .PP 216 | \fB\-\-sort=date\fR 217 | .RS 4 218 | specifies that the results should be sorted by descending (i\&.e\&. most recent first) date\&. This requires that there is an attribute in the index that is set as a timestamp\&. 219 | .RE 220 | .PP 221 | \fB\-\-rsort=date\fR 222 | .RS 4 223 | specifies that the results should be sorted by ascending (i\&.e\&. oldest first) date\&. This requires that there is an attribute in the index that is set as a timestamp\&. 224 | .RE 225 | .PP 226 | \fB\-\-sort=ts\fR 227 | .RS 4 228 | specifies that the results should be sorted by timestamp in groups; it will return all of the documents whose timestamp is within the last hour, then sorted within that bracket for relevance\&. After, it would return the documents from the last day, sorted by relevance, then the last week and then the last month\&. It is discussed in more detail under the 229 | \fBSPH_SORT_TIME_SEGMENTS\fR 230 | entry under the 231 | \fISorting modes\fR 232 | section of the manual\&. 233 | .RE 234 | .PP 235 | Other options: 236 | .PP 237 | \fB\-\-noinfo\fR, \fB\-q\fR 238 | .RS 4 239 | instructs 240 | \fBsearch\fR 241 | not to look\-up data in your SQL database\&. Specifically, for debugging with MySQL and 242 | \fBsearch\fR, you can provide it with a query to look up the full article based on the returned document ID\&. It is explained in more detail under the 243 | \fBsql_query_info\fR 244 | directive\&. 245 | .RE 246 | .SH "AUTHOR" 247 | .PP 248 | Andrey Aksenoff (shodan@sphinxsearch\&.com)\&. This manual page is written by Alexey Vinogradov (klirichek@sphinxsearch\&.com)\&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&. 249 | .PP 250 | On Debian systems, the complete text of the GNU General Public License can be found in 251 | /usr/share/common\-licenses/GPL\&. 252 | .SH "SEE ALSO" 253 | .PP 254 | \fBindexer\fR(1), 255 | \fBsearchd\fR(1), 256 | \fBindextool\fR(1) 257 | .PP 258 | Sphinx and it\*(Aqs programs are documented fully by the 259 | \fISphinx reference manual\fR 260 | available in 261 | /usr/share/doc/sphinxsearch\&. 262 | -------------------------------------------------------------------------------- /sphinx/share/man/man1/searchd.1: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Title: searchd 3 | .\" Author: [see the "Author" section] 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 5 | .\" Date: 03/26/2013 6 | .\" Manual: Sphinxsearch 7 | .\" Source: 2.0.7-release 8 | .\" Language: English 9 | .\" 10 | .TH "SEARCHD" "1" "03/26/2013" "2\&.0\&.7\-release" "Sphinxsearch" 11 | .\" ----------------------------------------------------------------- 12 | .\" * Define some portability stuff 13 | .\" ----------------------------------------------------------------- 14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | .\" http://bugs.debian.org/507673 16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html 17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .ie \n(.g .ds Aq \(aq 19 | .el .ds Aq ' 20 | .\" ----------------------------------------------------------------- 21 | .\" * set default formatting 22 | .\" ----------------------------------------------------------------- 23 | .\" disable hyphenation 24 | .nh 25 | .\" disable justification (adjust text to left margin only) 26 | .ad l 27 | .\" ----------------------------------------------------------------- 28 | .\" * MAIN CONTENT STARTS HERE * 29 | .\" ----------------------------------------------------------------- 30 | .SH "NAME" 31 | searchd \- Sphinxsearch network daemon\&. 32 | .SH "SYNOPSIS" 33 | .HP \w'\fBsearchd\fR\ 'u 34 | \fBsearchd\fR [\-\-config\ \fICONFIGFILE\fR] [\-\-cpustats] [\-\-iostats] [\-\-index\ \fIINDEX\fR] [\-\-port\ \fIPORT\fR] 35 | .HP \w'\fBsearchd\fR\ 'u 36 | \fBsearchd\fR \-\-status [\-\-config\ \fICONFIGFILE\fR] [\-\-pidfile\ \fIPIDFILE\fR] 37 | .HP \w'\fBsearchd\fR\ 'u 38 | \fBsearchd\fR \-\-stop [\-\-config\ \fICONFIGFILE\fR] [\-\-pidfile\ \fIPIDFILE\fR] 39 | .SH "DESCRIPTION" 40 | .PP 41 | Sphinx is a collection of programs that aim to provide high quality fulltext search\&. 42 | .PP 43 | Searchd is the second of the two principle tools as part of Sphinx\&. 44 | \fBsearchd\fR 45 | is the part of the system which actually handles searches; it functions as a server and is responsible for receiving queries, processing them and returning a dataset back to the different APIs for client applications\&. 46 | .PP 47 | Unlike 48 | \fBindexer\fR, 49 | \fBsearchd\fR 50 | is not designed to be run either from a regular script or command\-line calling, but instead either as a daemon to be called from 51 | \fIinit\&.d\fR 52 | (on Unix/Linux type systems) or to be called as a service (on Windows\-type systems)\&. so not all of the command line options will always apply, and so will be build\-dependent\&. 53 | .SH "OPTIONS" 54 | .PP 55 | These programs follow the usual GNU command line syntax, with long options starting with two dashes (`\-\*(Aq)\&. 56 | .PP 57 | The options available to searchd on all builds are: 58 | .PP 59 | \fB\-\-config\fR\fICONFIGFILE\fR, \fB\-c\fR\fICONFIGFILE\fR 60 | .RS 4 61 | Tell 62 | \fBsearchd\fR 63 | to use the given file as its configuration, just as with 64 | \fBindexer\fR\&. 65 | .RE 66 | .PP 67 | \fB\-\-console\fR 68 | .RS 4 69 | Force 70 | \fBsearchd\fR 71 | into console mode; typically it will be running as a conventional server application, and will aim to dump information into the log files (as specified in 72 | sphinx\&.conf)\&. Sometimes though, when debugging issues in the configuration or the daemon itself, or trying to diagnose hard\-to\-track\-down problems, it may be easier to force it to dump information directly to the console/command line from which it is being called\&. Running in console mode also means that the process will not be forked (so searches are done in sequence) and logs will not be written to\&. (It should be noted that console mode is not the intended method for running searchd\&.) 73 | .sp 74 | You can invoke it as such: 75 | .sp 76 | .if n \{\ 77 | .RS 4 78 | .\} 79 | .nf 80 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-console 81 | .fi 82 | .if n \{\ 83 | .RE 84 | .\} 85 | .RE 86 | .PP 87 | \fB\-\-cpustats\fR 88 | .RS 4 89 | Used to provide actual CPU time report (in addition to wall time) in both query log file (for every given query) and status report (aggregated)\&. It depends on 90 | \fIclock_gettime()\fR 91 | system call and might therefore be unavailable on certain systems\&. 92 | .sp 93 | You might start searchd thus: 94 | .sp 95 | .if n \{\ 96 | .RS 4 97 | .\} 98 | .nf 99 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-cpustats 100 | .fi 101 | .if n \{\ 102 | .RE 103 | .\} 104 | .RE 105 | .PP 106 | \fB\-\-help\fR, \fB\-h\fR, \fB\-\-?\fR, \fB\-?\fR 107 | .RS 4 108 | List all of the parameters that can be called in your particular build of 109 | \fBsearchd\fR\&. 110 | .RE 111 | .PP 112 | \fB\-\-index\fR\ \&\fIINDEX\fR, \fB\-i\fR\ \&\fIINDEX\fR 113 | .RS 4 114 | Serve only the specified index\&. Like 115 | \fB\-\-port\fR, this is usually for debugging purposes; more long\-term changes would generally be applied to the configuration file itself\&. 116 | .sp 117 | Usage example: 118 | .sp 119 | .if n \{\ 120 | .RS 4 121 | .\} 122 | .nf 123 | $ searchd \-\-index myindex 124 | .fi 125 | .if n \{\ 126 | .RE 127 | .\} 128 | .RE 129 | .PP 130 | \fB\-\-iostats\fR 131 | .RS 4 132 | Used in conjuction with the logging options (the 133 | \fBquery_log\fR 134 | will need to have been activated in 135 | sphinx\&.conf) to provide more detailed information on a per\-query basis as to the input/output operations carried out in the course of that query, with a slight performance hit and of course bigger logs\&. Further details are available under the query log format section\&. 136 | .sp 137 | You might start searchd thus: 138 | .sp 139 | .if n \{\ 140 | .RS 4 141 | .\} 142 | .nf 143 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-iostats 144 | .fi 145 | .if n \{\ 146 | .RE 147 | .\} 148 | .RE 149 | .PP 150 | \fB\-\-listen\fR, \fB\-l\fR\ \&\fI( address ":" port | port | path ) [ ":" protocol ]\fR 151 | .RS 4 152 | Works as 153 | \fB\-\-port\fR, but allow you to specify not only the port, but full path, as IP address and port, or Unix\-domain socket path, that 154 | \fBsearchd\fR 155 | will listen on\&. Otherwords, you can specify either an IP address (or hostname) and port number, or just a port number, or Unix socket path\&. If you specify port number but not the address, searchd will listen on all network interfaces\&. Unix path is identified by a leading slash\&. As the last param you can also specify a protocol handler (listener) to be used for connections on this socket\&. Supported protocol values are \*(Aqsphinx\*(Aq (Sphinx 0\&.9\&.x API protocol) and \*(Aqmysql41\*(Aq (MySQL protocol used since 4\&.1 upto at least 5\&.1)\&. 156 | .RE 157 | .PP 158 | \fB\-\-logdebug, \-\-logdebugv, \-\-logdebugvv\fR 159 | .RS 4 160 | Enable additional debug output in the daemon log\&. Should only be needed rarely, to assist with debugging issues that could not be easily reproduced on request\&. 161 | \fB\-\-logdebug\fR 162 | causes daemon to fire general debug messages\&. 163 | \fB\-\-logdebugv\fR 164 | and 165 | \fB\-\-logdebugvv\fR 166 | points to \*(Aqverbose\*(Aq and \*(Aqvery verbose\*(Aq debug info\&. The last could really flood your logfile\&. 167 | .RE 168 | .PP 169 | \fB\-\-nodetach\fR 170 | .RS 4 171 | Do not \*(Aqdaemonize\*(Aq, or, do not detach into background\&. Apart debug purposes, this switch is useful when you manage sphinx with upstart init daemon\&. In this case actual \*(Aqdaemonizing\*(Aq will be done by upstart itself, and also all tasks like starting, stopping, reloading the config and respawning on crash will be done by the system, not the sphinx\&. 172 | .RE 173 | .PP 174 | \fB\-\-pidfile\fR \fIPIDFILE\fR 175 | .RS 4 176 | Explicitly state a PID file, where the process information is stored regarding 177 | \fBsearchd\fR, used for inter\-process communications (for example, 178 | \fBindexer\fR 179 | will need to know the PID to contact 180 | \fBsearchd\fR 181 | for rotating indexes)\&. Normally, 182 | \fBsearchd\fR 183 | would use a PID if running in regular mode (i\&.e\&. not with 184 | \fB\-\-console\fR), but it is possible that you will be running it in console mode whilst the index is being updated and rotated, for which a PID file will be needed\&. 185 | .sp 186 | Example: 187 | .sp 188 | .if n \{\ 189 | .RS 4 190 | .\} 191 | .nf 192 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-pidfile /home/myuser/sphinx\&.pid 193 | .fi 194 | .if n \{\ 195 | .RE 196 | .\} 197 | .RE 198 | .PP 199 | \fB\-\-replay\-flags\fR\ \&\fIOPTIONS\fR 200 | .RS 4 201 | Specify a list of extra binary log replay options\&. The supported options are: 202 | .sp 203 | .RS 4 204 | .ie n \{\ 205 | \h'-04'\(bu\h'+03'\c 206 | .\} 207 | .el \{\ 208 | .sp -1 209 | .IP \(bu 2.3 210 | .\} 211 | \fBaccept\-desc\-timestamp\fR, ignore descending transaction timestamps and replay such transactions anyway (the default behavior is to exit with an error)\&. 212 | .RE 213 | .sp 214 | Example: 215 | .sp 216 | .if n \{\ 217 | .RS 4 218 | .\} 219 | .nf 220 | $ searchd \-\-replay\-flags=accept\-desc\-timestamp 221 | .fi 222 | .if n \{\ 223 | .RE 224 | .\} 225 | .RE 226 | .PP 227 | \fB\-\-port\fR\ \&\fIPORT\fR, \fB\-p\fR\ \&\fIPORT\fR 228 | .RS 4 229 | Specify the 230 | \fIport\fR 231 | that 232 | \fBsearchd\fR 233 | should listen on, usually for debugging purposes\&. This will usually default to 234 | \fB9312\fR, but sometimes you need to run it on a different port\&. Specifying it on the command line will override anything specified in the configuration file\&. The valid range is 0 to 65535, but ports numbered 1024 and below usually require a privileged account in order to run\&. Look also the 235 | \fB\-\-listen\fR 236 | option, it will give you more possibilities to tune here\&. 237 | .sp 238 | An example of usage: 239 | .sp 240 | .if n \{\ 241 | .RS 4 242 | .\} 243 | .nf 244 | $ searchd \-\-port 9313 245 | .fi 246 | .if n \{\ 247 | .RE 248 | .\} 249 | .RE 250 | .PP 251 | \fB\-\-safetrace\fR 252 | .RS 4 253 | Forces 254 | \fBsearchd\fR 255 | to only use system backtrace() call in crash reports\&. In certain (rare) scenarios, this might be a "safer" way to get that report\&. This is a debugging option\&. 256 | .RE 257 | .PP 258 | \fB\-\-status\fR 259 | .RS 4 260 | Query running 261 | \fBsearchd\fR 262 | instance status, using the connection details from the (optionally) provided configuration file\&. It will try to connect to the running instance using the first configured UNIX socket or TCP port\&. On success, it will query for a number of status and performance counter values and print them\&. You can use 263 | \fIStatus()\fR 264 | API call to access the very same counters from your application\&. 265 | .sp 266 | Examples: 267 | .sp 268 | .if n \{\ 269 | .RS 4 270 | .\} 271 | .nf 272 | $ searchd \-\-status 273 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-status 274 | .fi 275 | .if n \{\ 276 | .RE 277 | .\} 278 | .RE 279 | .PP 280 | \fB\-\-stop\fR 281 | .RS 4 282 | Asynchronously stop 283 | \fBsearchd\fR, using the details of the PID file as specified in the 284 | sphinx\&.conf 285 | file, so you may also need to confirm to 286 | \fBsearchd\fR 287 | which configuration file to use with the 288 | \fB\-\-config\fR 289 | option\&. NB, calling 290 | \fB\-\-stop\fR 291 | will also make sure any changes applied to the indexes with 292 | \fIUpdateAttributes()\fR 293 | will be applied to the index files themselves\&. 294 | .sp 295 | Example: 296 | .sp 297 | .if n \{\ 298 | .RS 4 299 | .\} 300 | .nf 301 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-stop 302 | .fi 303 | .if n \{\ 304 | .RE 305 | .\} 306 | .RE 307 | .PP 308 | \fB\-\-stopwait\fR 309 | .RS 4 310 | Synchronously stop 311 | \fBsearchd\fR\&. 312 | \fB\-\-stop\fR 313 | essentially tells the running instance to exit (by sending it a 314 | \fISIGTERM\fR) and then immediately returns\&. 315 | \fB\-\-stopwait\fR 316 | will also attempt to wait until the running 317 | \fBsearchd\fR 318 | instance actually finishes the shutdown (eg\&. saves all the pending attribute changes) and exits\&. 319 | .sp 320 | Example: 321 | .sp 322 | .if n \{\ 323 | .RS 4 324 | .\} 325 | .nf 326 | $ searchd \-\-config /home/myuser/sphinx\&.conf \-\-stopwait 327 | .fi 328 | .if n \{\ 329 | .RE 330 | .\} 331 | .sp 332 | Possible exit codes are as follows: 333 | .sp 334 | .RS 4 335 | .ie n \{\ 336 | \h'-04'\(bu\h'+03'\c 337 | .\} 338 | .el \{\ 339 | .sp -1 340 | .IP \(bu 2.3 341 | .\} 342 | 0 on success; 343 | .RE 344 | .sp 345 | .RS 4 346 | .ie n \{\ 347 | \h'-04'\(bu\h'+03'\c 348 | .\} 349 | .el \{\ 350 | .sp -1 351 | .IP \(bu 2.3 352 | .\} 353 | 1 if connection to running 354 | \fBsearchd\fR 355 | daemon failed; 356 | .RE 357 | .sp 358 | .RS 4 359 | .ie n \{\ 360 | \h'-04'\(bu\h'+03'\c 361 | .\} 362 | .el \{\ 363 | .sp -1 364 | .IP \(bu 2.3 365 | .\} 366 | 2 if daemon reported an error during shutdown; 367 | .RE 368 | .sp 369 | .RS 4 370 | .ie n \{\ 371 | \h'-04'\(bu\h'+03'\c 372 | .\} 373 | .el \{\ 374 | .sp -1 375 | .IP \(bu 2.3 376 | .\} 377 | 3 if daemon crashed during shutdown 378 | .RE 379 | .RE 380 | .PP 381 | \fB\-\-strip\-path\fR 382 | .RS 4 383 | Strip the path names from all the file names referenced from the index (\fIstopwords\fR, 384 | \fIwordforms\fR, 385 | \fIexceptions\fR, etc)\&. This is useful for picking up indexes built on another machine with possibly different path layouts\&. 386 | .RE 387 | .SH "SIGNALS" 388 | .PP 389 | Last but not least, as every other daemon, 390 | \fBsearchd\fR 391 | supports a number of signals\&. 392 | .PP 393 | .PP 394 | SIGTERM 395 | .RS 4 396 | Initiates a clean shutdown\&. New queries will not be handled; but queries that are already started will not be forcibly interrupted\&. 397 | .RE 398 | .PP 399 | SIGHUP 400 | .RS 4 401 | Initiates index rotation\&. Depending on the value of 402 | \fBseamless_rotate\fR 403 | setting, new queries might be shortly stalled; clients will receive temporary errors\&. 404 | .RE 405 | .PP 406 | SIGUSR1 407 | .RS 4 408 | Forces reopen of searchd log and query log files, letting you implement log file rotation\&. 409 | .RE 410 | .SH "AUTHOR" 411 | .PP 412 | Andrey Aksenoff (shodan@sphinxsearch\&.com)\&. This manual page is written by Alexey Vinogradov (klirichek@sphinxsearch\&.com), using the one written by Christian Hofstaedtler ch+debian\-packages@zeha\&.at for the 413 | \fBDebian\fR 414 | system (but may be used by others)\&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&. 415 | .PP 416 | On Debian systems, the complete text of the GNU General Public License can be found in 417 | /usr/share/common\-licenses/GPL\&. 418 | .SH "SEE ALSO" 419 | .PP 420 | \fBindexer\fR(1), 421 | \fBsearch\fR(1), 422 | \fBindextool\fR(1) 423 | .PP 424 | Sphinx and it\*(Aqs programs are documented fully by the 425 | \fISphinx reference manual\fR 426 | available in 427 | /usr/share/doc/sphinxsearch\&. 428 | -------------------------------------------------------------------------------- /sphinx/share/man/man1/spelldump.1: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Title: spelldump 3 | .\" Author: [see the "Author" section] 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 5 | .\" Date: 03/26/2013 6 | .\" Manual: Sphinxsearch 7 | .\" Source: 2.0.7-release 8 | .\" Language: English 9 | .\" 10 | .TH "SPELLDUMP" "1" "03/26/2013" "2\&.0\&.7\-release" "Sphinxsearch" 11 | .\" ----------------------------------------------------------------- 12 | .\" * Define some portability stuff 13 | .\" ----------------------------------------------------------------- 14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | .\" http://bugs.debian.org/507673 16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html 17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .ie \n(.g .ds Aq \(aq 19 | .el .ds Aq ' 20 | .\" ----------------------------------------------------------------- 21 | .\" * set default formatting 22 | .\" ----------------------------------------------------------------- 23 | .\" disable hyphenation 24 | .nh 25 | .\" disable justification (adjust text to left margin only) 26 | .ad l 27 | .\" ----------------------------------------------------------------- 28 | .\" * MAIN CONTENT STARTS HERE * 29 | .\" ----------------------------------------------------------------- 30 | .SH "NAME" 31 | spelldump \- Sphinxsearch tool for extract the contents of a dictionary file\&. 32 | .SH "SYNOPSIS" 33 | .HP \w'\fBspelldump\fR\ 'u 34 | \fBspelldump\fR [OPTIONS] dictionary affix [result] [locale\-name] 35 | .SH "DESCRIPTION" 36 | .PP 37 | Sphinx is a collection of programs that aim to provide high quality fulltext search\&. 38 | .PP 39 | spelldump is used to extract the contents of a dictionary file that uses ispell or MySpell format, which can help build word lists for wordforms \- all of the possible forms are pre\-built for you\&. 40 | .PP 41 | The two main parameters are the dictionary\*(Aqs main file and its affix file; usually these are named as 42 | [language\-prefix]\&.dict 43 | and 44 | [language\-prefix]\&.aff 45 | and will be available with most common Linux distributions, as well as various places online\&. 46 | \fB[result]\fR 47 | specifies where the dictionary data should be output to, and 48 | \fB[locale\-name]\fR 49 | additionally specifies the locale details you wish to use\&. 50 | .PP 51 | Examples of its usage are: 52 | .PP 53 | .if n \{\ 54 | .RS 4 55 | .\} 56 | .nf 57 | spelldump en\&.dict en\&.aff 58 | spelldump ru\&.dict ru\&.aff ru\&.txt ru_RU\&.CP1251 59 | spelldump ru\&.dict ru\&.aff ru\&.txt \&.1251 60 | .fi 61 | .if n \{\ 62 | .RE 63 | .\} 64 | .PP 65 | The results file will contain a list of all the words in the dictionary in alphabetical order, output in the format of a wordforms file, which you can use to customise for your specific circumstances\&. 66 | .PP 67 | An example of the result file: 68 | .PP 69 | .if n \{\ 70 | .RS 4 71 | .\} 72 | .nf 73 | zone > zone 74 | zoned > zoned 75 | zoning > zoning 76 | .fi 77 | .if n \{\ 78 | .RE 79 | .\} 80 | .SH "OPTIONS" 81 | .PP 82 | \fB\-c\fR\ \&\fI[FILE]\fR 83 | .RS 4 84 | specifies a file for case conversion details\&. 85 | .RE 86 | .SH "AUTHOR" 87 | .PP 88 | Andrey Aksenoff (shodan@sphinxsearch\&.com)\&. This manual page is written by Alexey Vinogradov (klirichek@sphinxsearch\&.com)\&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&. 89 | .PP 90 | On Debian systems, the complete text of the GNU General Public License can be found in 91 | /usr/share/common\-licenses/GPL\&. 92 | .SH "SEE ALSO" 93 | .PP 94 | \fBindexer\fR(1), 95 | \fBindextool\fR(1)\&. 96 | .PP 97 | Sphinx and it\*(Aqs programs are documented fully by the 98 | \fISphinx reference manual\fR 99 | available in 100 | /usr/share/doc/sphinxsearch\&. 101 | --------------------------------------------------------------------------------