diff --git a/src/doc/user/usermanual.sgml b/src/doc/user/usermanual.sgml index 4cd2771a..1b561fa7 100644 --- a/src/doc/user/usermanual.sgml +++ b/src/doc/user/usermanual.sgml @@ -24,7 +24,7 @@ Dockes - $Id: usermanual.sgml,v 1.12 2006-04-08 14:00:14 dockes Exp $ + $Id: usermanual.sgml,v 1.13 2006-04-27 09:23:10 dockes Exp $ This document introduces full text search notions @@ -247,6 +247,26 @@ The index data directory only contains data that will be rebuilt by an index run, so that it can be destroyed safely. + + Security aspects + + The &RCL; index does not hold copies of the indexed + documents. But it does hold enough data to allow for an almost + complete reconstruction. If confidential data is indexed, + access to the database directory should be restricted. + + As of version 1.4, &RCL; will create the configuration + directory with a mode of 0700 (access by owner only). As the + index directory is by default a subdirectory of the + configuration directory, this should result in appropriate + protection. + + If you use another setup, you should think of the kind + of protection you need for your index, and set the directory + access modes appropriately. + + + @@ -353,7 +373,13 @@ look for file names, and allows using wildcards (*, ? , []). - + + &RCL; remembers the last few searches that you + performed. You can use the simple search text entry widget (a + combobox) to recall them (click on the thing at the right of the + text field). Please note, however, that only the search texts + are remembered, not the mode (all/any/filename). + You can use the Tools / Advanced search dialog for more complex searches. @@ -413,6 +439,35 @@ + + Multiple databases + + Your &RCL; configuration always defines a main index. This + is what gets updated, for example, when you execute + recollindex. + + You can use the search configuration + tool to define additional databases to be searched. These + databases can be made active or inactive at any moment. + + The typical use of this feature is for a system + administrator to set up a central index, that you may choose to + search, or not, in addition to your personal data. Of course, + there are other possibilities. + + The main index (defined by your personal configuration) is + always active. + + The list of searchable databases may also be defined by + the RECOLL_EXTRA_DBS environment + variable. This should hold a colon-separated list of index + directories, ie: + export RECOLL_EXTRA_DBS=/some/place/xapiandb:/some/other/db + + + + Document history @@ -444,6 +499,35 @@ + + Additional result list functionality + + Apart from the preview and edit links, you can display a + popup menu by right-clicking over a paragraph in the result + list. This menu has the following entries: + + + Preview + Edit + Copy File Name + Copy Url + More like this + + + The Preview and + Edit entries do the same thing as the + corresponding links. The two following entries will copy either + an url or the file path to the clipboard, for pasting into + another application. + + The More like this entry will select + a number of relevant term from the current document and enter + them into the simple search field. You can then start a simple + search, with a good chance of finding documents related to the + current result. + + + Search tips, shortcuts @@ -466,6 +550,28 @@ search dialog to the same effect. + Term completion + Typing ^TAB (Control+Tab) in the simple + search entry field while entering a word will either complete + the current word if its beginning matches a unique term in the + index, or open a window to propose a list of completions + + + Picking up new terms for search from displayed + documents + Double-clicking on a word in the result list or in a + preview window will copy it to the simple search entry field. + + + Finding related documents + Selecting the More like this entry + in the result list paragraph right-click menu will select a + set of "interesting" terms from the current result, and insert + them into the simple search entry field. You can then possibly + edit the list and start a search to find documents which may + be apparented to the current result. + + Query explanation You can get an exact description of what the query looked for, including stem expansion, and boolean operators @@ -486,11 +592,13 @@ Entering ^Q almost anywhere will close the application. + Closing previews Entering ^W in a preview tab will close it (and, for the last tab, close the preview window). + @@ -504,7 +612,8 @@ interface itself, and with the parameters used for searching and returning results. - User interface parameters: + User interface parameters: + Number of results in a result @@ -524,15 +633,28 @@ manual. You can enter a simple name if the command is in your PATH, or browse for a full pathname. + Show document type icons in result list: icons in the result list can be turned off. They take quite a lot of space and convey relatively little useful information. + + Auto-start simple search on + whitespace entry: if this is checked, a search will + be executed each time you enter a space in the simple search + input field. This lets you look at the result list as you + enter new terms. This is off by default, you may like it or + not... + + + + - Search parameters: + Search parameters: + Stemming language: stemming obviously depends on the document's language. This @@ -560,6 +682,28 @@ within the document itself. + + + + Extra + databases: + + + This panel will let you browse for additional databases + that you may want to search. Extra databases are designated by + their database directory (ie: + /home/someothergui/.recoll/xapiandb, + /usr/local/recollglobal/xapiandb). + + Once entered, the databases will appear in the + All extra databases list, and you can + chose which ones you want to use at any moment by tranferring + them to/from the Active extra databases + list. + Your main database (the one the current configuration + indexes to), is always implicitely active. If this is not + desirable, you can set up your configuration so that it indexes, + for example, an empty directory. @@ -577,7 +721,7 @@ At the very least, you will need to download and install the xapian core package - (&RCL; currently uses version 0.9.2), and the qt runtime and development packages (&RCL; development currently uses version 3.3.5, but any 3.3 version is diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index 3e1dccbd..fde07e33 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.9 2006-04-18 08:53:28 dockes Exp $ (C) 2005 Jean-Francois Dockes"; +static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.10 2006-04-27 09:23:10 dockes Exp $ (C) 2005 Jean-Francois Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -141,6 +141,15 @@ void rwSettings(bool writing) SETTING_RW(prefs.queryReplaceAbstract, "/Recoll/prefs/query/replaceAbstract", Bool, false); + // Ssearch combobox history list + if (writing) { + settings.writeEntry("/Recoll/prefs/query/ssearchHistory", + prefs.ssearchHistory); + } else { + prefs.ssearchHistory = + settings.readListEntry("/Recoll/prefs/query/ssearchHistory"); + } + // The extra databases settings. These are stored as a list of // xapian directory names, encoded in base64 to avoid any // binary/charset conversion issues. There are 2 lists for all diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h index d551b586..52766353 100644 --- a/src/qtgui/guiutils.h +++ b/src/qtgui/guiutils.h @@ -17,7 +17,7 @@ #ifndef _GUIUTILS_H_INCLUDED_ #define _GUIUTILS_H_INCLUDED_ /* - * @(#$Id: guiutils.h,v 1.5 2006-04-18 08:53:28 dockes Exp $ (C) 2005 Jean-Francois Dockes + * @(#$Id: guiutils.h,v 1.6 2006-04-27 09:23:10 dockes Exp $ (C) 2005 Jean-Francois Dockes * jean-francois.dockes@wanadoo.fr * * This program is free software; you can redistribute it and/or modify @@ -39,6 +39,7 @@ #include #include #include +#include #ifndef NO_NAMESPACES using std::string; @@ -67,6 +68,8 @@ class PrefsPack { // to the qt settings file to avoid any bin string/ charset conv issues list allExtraDbs; list activeExtraDbs; + // Textual history of simple searches (this is just the combobox list) + QStringList ssearchHistory; PrefsPack() : showicons(true), diff --git a/src/qtgui/rclmain.cpp b/src/qtgui/rclmain.cpp index b1fc9a0b..2a2f1ff1 100644 --- a/src/qtgui/rclmain.cpp +++ b/src/qtgui/rclmain.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.26 2006-04-27 06:12:10 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.27 2006-04-27 09:23:10 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -457,9 +457,9 @@ void RclMain::ssearchAddTerm(QString term) return; term = QString::fromUtf8(t.c_str()); - QString text = sSearch->queryText->text(); + QString text = sSearch->queryText->currentText(); text += QString::fromLatin1(" ") + term; - sSearch->queryText->setText(text); + sSearch->queryText->setEditText(text); } void RclMain::startNativeViewer(int docnum) @@ -543,12 +543,16 @@ void RclMain::docExpand(int docnum) list terms; terms = rcldb->expand(doc); // Do we keep the original query. I think we'd better not. - QString text;// = sSearch->queryText->text(); + // rcldb->expand is set to keep the original query terms instead. + QString text;// = sSearch->queryText->currentText(); for (list::iterator it = terms.begin(); it != terms.end(); it++) { text += QString::fromLatin1(" \"") + QString::fromUtf8((*it).c_str()) + QString::fromLatin1("\""); } - sSearch->queryText->setText(text); + // We need to insert item here, its not auto-done like when the user types + // CR + sSearch->queryText->setEditText(text); + sSearch->queryText->insertItem(text, 0); sSearch->setAnyTermMode(); sSearch->startSimpleSearch(); } diff --git a/src/qtgui/ssearchb.ui b/src/qtgui/ssearchb.ui index 0c90c12e..49eb85d0 100644 --- a/src/qtgui/ssearchb.ui +++ b/src/qtgui/ssearchb.ui @@ -72,7 +72,7 @@ Choose type of search: any term, all terms, filename with possible wildcards. - + queryText @@ -90,11 +90,20 @@ 0 - - LineEditPanel + + true - - Sunken + + 20 + + + 30 + + + AtTop + + + false Enter search terms here @@ -111,24 +120,6 @@ SSearchBase startSimpleSearch() - - queryText - returnPressed() - SSearchBase - startSimpleSearch() - - - queryText - textChanged(const QString&) - SSearchBase - searchTextChanged(const QString&) - - - clearqPB - clicked() - queryText - clear() - recoll.h @@ -145,9 +136,9 @@ init() + setAnyTermMode() completion() event( QEvent * evt ) - setAnyTermMode() diff --git a/src/qtgui/ssearchb.ui.h b/src/qtgui/ssearchb.ui.h index 84c840cd..55ed3caa 100644 --- a/src/qtgui/ssearchb.ui.h +++ b/src/qtgui/ssearchb.ui.h @@ -37,6 +37,14 @@ void SSearchBase::init() searchTypCMB->insertItem(tr("Any term")); searchTypCMB->insertItem(tr("All terms")); searchTypCMB->insertItem(tr("File name")); + queryText->insertStringList(prefs.ssearchHistory); + queryText->setEditText(""); + connect(queryText->lineEdit(), SIGNAL(returnPressed()), + this, SLOT(startSimpleSearch())); + connect(queryText->lineEdit(), SIGNAL(textChanged(const QString&)), + this, SLOT(searchTextChanged(const QString&))); + connect(clearqPB, SIGNAL(clicked()), + queryText->lineEdit(), SLOT(clear())); } void SSearchBase::searchTextChanged( const QString & text ) @@ -48,7 +56,7 @@ void SSearchBase::searchTextChanged( const QString & text ) } else { searchPB->setEnabled(true); clearqPB->setEnabled(true); - string u8 = (const char *)queryText->text().utf8(); + string u8 = (const char *)queryText->currentText().utf8(); if (prefs.autoSearchOnWS && !u8.empty() && u8[u8.length()-1] == ' ') startSimpleSearch(); } @@ -59,7 +67,7 @@ void SSearchBase::startSimpleSearch() LOGDEB(("SSearchBase::startSimpleSearch\n")); Rcl::AdvSearchData sdata; - QCString u8 = queryText->text().utf8(); + QCString u8 = queryText->currentText().utf8(); switch (searchTypCMB->currentItem()) { case 0: default: @@ -72,9 +80,13 @@ void SSearchBase::startSimpleSearch() sdata.filename = u8; break; } + prefs.ssearchHistory.clear(); + for (int index = 0; index < queryText->count(); index++) + prefs.ssearchHistory.push_back(queryText->text(index)); emit startSearch(sdata); } + void SSearchBase::setAnyTermMode() { searchTypCMB->setCurrentItem(0); @@ -91,7 +103,7 @@ void SSearchBase::completion() return; } // Extract last word in text - string txt = (const char *)queryText->text().utf8(); + string txt = (const char *)queryText->currentText().utf8(); string::size_type cs = txt.find_last_of(" "); if (cs == string::npos) cs = 0; @@ -131,7 +143,7 @@ void SSearchBase::completion() if (ok) { txt.erase(cs); txt.append(res.utf8()); - queryText->setText(QString::fromUtf8(txt.c_str())); + queryText->setEditText(QString::fromUtf8(txt.c_str())); } else { return; }