| Index of /~ben/plush |
Name Last modified Size Description
Parent Directory 01-Aug-2008 11:52 -
CHANGES.html 12-Apr-2007 10:35 11k
api/ 18-Jan-2007 10:44 -
plush-0.3.0.tar.gz 31-Mar-2008 15:08 22k
| Author: | Benoit Delbosc |
|---|---|
| Address: | bdelbosc _at_ nuxeo.com |
| Version: | Plush/0.3.0 |
| Revision: | README.txt 51527 2007-04-12 08:34:52Z bdelbosc |
| Copyright: | (C) Copyright 2007 Nuxeo SAS (http://nuxeo.com). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
Abstract
This document describes the usage of the Plush. It is a is a simple interactive command line shell to inspect a Lucene indexes.
Plush is PyLUcene SHell to play with a Lucene indexes interactively.
Main features:
Why using Plush instead of Luke ?
For other cases have a look to the great Luke tool.
Get the latest package from python Cheese Shop.
Or use the bleeding edge
svn co http://svn.nuxeo.org/pub/tools/plush/trunk plush
You need python 2.4 (2.3 not tested) with the readline support (--enable-readline)
Plush requires PyLucene which is easy to install using binaries.
Here is an example on how to install the latest PyLucene 2.0.0-3 (Lucene 2.0.0-453447) on ubuntu:
cd /tmp wget http://downloads.osafoundation.org/PyLucene/linux/ubuntu/PyLucene-2.0.0-3.tar.gz tar xzvf PyLucene-2.0.0-3.tar.gz cd PyLucene-2.0.0-3/ sudo cp -r python/* /usr/lib/python2.4/site-packages/ sudo cp -r gcj/* /usr/local/lib
Visit the PyLucene site for other pre-built binaries.
Plush is a pure python package that you can get from the Python Cheese Shop
tar xzvf plush-X.Y.Z.tar.gz cd plush
Install plush either with:
sudo make install
or using the pythonic way:
python setup.py build sudo python setup.py install
Thats all no .jar nor java required.
Plush commands begin with a backslash other inputs are traited as Lucene query.
plush > \help Documented commands (type \help <topic>): ======================================== close describe_indexes di exit history open quit term v d describe_store echo help nuxset q set unset view
$ plush
plush
Welcome to Plush 0.1.0, a Lucene interactive terminal.
Using PyLucene 2.0.0-3 and Lucene 2.0.0-453447.
Type: \open [INDEX_PATH] to open a lucene store
\? for help
\q or ^D to quit.
plush> \open tmp/PyLucene-2.0.0-3/samples/index
Opening store: /home/ben/tmp/PyLucene-2.0.0-3/samples/index
plush> \d
Directory info
--------------
* Directory path : /home/ben/tmp/PyLucene-2.0.0-3/samples/index
* Directory current version : 1168939081493
* Number of docs : 578 (max doc num: 580)
* Number of fields : 3
* Index last modified : 2007-01-30T11:04:46
* Index status : unlocked
* Has deletions : YES
* Directory implementation : org.apache.lucene.store.FSDirectory
plush> \di
Index info
----------
Found 3 fields for doc #579:
* contents Stored Indexed Tokenized
* name Stored Indexed
* path Stored Indexed
plush> foo -bar
Searching: foo -bar
------------------------------------
Default search index: contents
Simple analyzer tokens: foo, bar
Found 3 matching document(s) in 0.002s
* 00) score: 0.56, doc_num: 218
name: migrating-from-nuxmetadirectories.txt
path: /home...migrating-from-nuxmetadirectories.txt
* 01) score: 0.40, doc_num: 246
name: creating-new-content-types.txt
path: /home...creating-new-content-types.txt
* 02) score: 0.16, doc_num: 184
name: guidelines-user_interface.txt
path: /home...guidelines-user_interface.txt
Found 3 matching document(s) in 0.002s
plush> \v 184
Found 3 fields for doc #184
contents S I T : <snip>file content</snip>
name S I : guidelines-user_interface.txt
path S I : /home...guidelines-user_interface.txt
plush> \v 184 ^name
Found 3 fields for doc #184
name S I : guidelines-user_interface.txt
plush> \set
limit = 5
select = name path
default_field = contents
sort_on =
waterline =
analyzer = Simple
plush> \set sort_on contents
It is not possible to sort on a tokenized field
plush> \term contents
Top 5 term occurences for field 'contents' matching '*'.
occurences term
---------- ----
455 http
455 information
452 more
446 directory
434 copy
---------- ----
plush> \set limit 7
limit key setted.
plush> \term name \.txt$
Top 7 term occurences for field 'name' matching '\.txt$'.
occurences term
---------- ----
449 README.txt
13 DEPENDENCIES.txt
13 refresh.txt
6 TODO.txt
5 INSTALL.txt
5 LICENSE.txt
3 COPYING.txt
---------- ----
plush> ^D
Bye
The command history is saved in the ~/.plush_history file.
You can use the NXLucene analyzers by setting an environnement variable NXLUCENE_HOME that point to the path where the analyzers python module can be loaded.
$ export NXLUCENE_HOME=/usr/local/nxlucene/src/nxlucene $ plush NXLucene analyzers Loaded. ... plush> \set analyzer french Error: Invalid analyzer. Possible values are: nxfrench, nxsort, Whitespace, Keyword, nxstandard, German, Stop, French, Standard, Simple, nxurl, nxkeyword plush> \set analyzer nxfrench plush> l'œuvre d'art Searching: l'œuvre d'art ------------------------------------ Default search index: contents nxfrench analyzer tokens: oeuvr, art ...
NXLucene analyzers are prefixed with nx.
ImportError: No module named readline
You need to compile your python with readline support which requires the readline-devel package
./configure --enable-readline