Thursday, July 7, 2011

Sphinx Commands For Beginners

#INDEXER

Configuring single index
indexer --config /full path/sphinx.conf myindex
Configuring all indices
indexer --config /full path/sphinx.conf --all
Rotating single index
indexer --rotate myindex
Rotating all indices
indexer --rotate --all
No output on rotation
indexer --rotate --all --quiet
Not to display progress detail
indexer --rotate --all --noprogress

#SEARCHD

Help
searchd --help
Configuring searchd
searchd --config /full path/sphinx.conf
Configuring port
searchd --port 9313

Status
searchd --status

Checking Status
searchd --config /full path/sphinx.conf --status
IO status
searchd --config /full path/sphinx.conf --iostats
CPU status
searchd --config /full path/sphinx.conf --cpustats

Setting PID file
searchd --config /full path/sphinx.conf --pidfile /home/myuser/sphinx.pid
Forcing to search specified index
searchd --index myindex
Stopping search process
searchd --config /full path/sphinx.conf --stop
Killing all search process
killall searchd


STEPS TO DO IF SPHINX SEARCH IS NOT WORKING

1. killall searchd
2. searchd --config /full path/sphinx.conf --status
3. searchd --pidfile --config /fullpath/sphinx.conf
4. searchd --config /full path/sphinx.conf --status
5. indexer --config /full path/sphinx.conf --all
6. indexer --rotate --all

COMMAND TO SEARCH
search -i myindex -e 'test'

Search Attributes
1. Match modes (--any / --phrase / --boolean / --ext / --ext2 / --filter attr v)
2. Set Limit (--limit count)
3. Set offset value (--offset count)
4. Sort by group (--group attr)
5. Sort by ASC/DESC (--sortby clause)
6. Sort by timestamp attribute (--rsort)




With Regards,
Er.Animesh Nanda
Software Developer,
Manusis Technology Pvt. Ltd.
Bengaluru,Karnataka,INDIA.

No comments:

Post a Comment