Differences between revisions 44 and 154 (spanning 110 versions)
Revision 44 as of 2007-10-20 12:50:26
Size: 1500
Editor: p54A5E4BF
Comment:
Revision 154 as of 2012-01-25 20:54:30
Size: 3918
Editor: Hannah Bast
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#acl All:read
Line 2: Line 3:
== Documentation == = CompleteSearch =
Line 4: Line 5:
[wiki:Self:completesearch/IndexBuilding Index Building: Tools, Formats, etc.] [[MpiiWiki|Old Wiki from the MPII]] (lots of detailed / internal information)
Line 6: Line 7:
[wiki:Self:completesearch/DocumentFormats Document Formats: .docs, .words, .vocabulary, etc.] == Quick Intro ==
Line 8: Line 9:
[wiki:Self:completesearch/OverviewCode Source code overview] Follow these steps to checkout the !CompleteSearch code from our SVN, build it, build an index, run a server on that index, and ask queries to that server via HTTP. Don't be afraid, it's easy. If you have questions, send an email to Hannah Bast <bast@informatik.uni-freiburg.de>.
Line 10: Line 11:
[wiki:Self:CodingConventions Coding Conventions] === 0. Get source code ===
Line 12: Line 13:
[wiki:Self:completesearch/DesignConventions OO and C++ Design Conventions] {{{
svn checkout
http://vulcano.informatik.uni-freiburg.de/svn/completesearch/codebase
Username: [ask us]
Password: [ask us]
}}}
Line 14: Line 20:
=== 1. Compile ===
Line 15: Line 22:
{{{
make all
}}}
Line 16: Line 26:
== Compilation etc. == This will build three binaries:
Line 18: Line 28:
[wiki:Self:completesearch/Installation Installation Guide]  * buildIndex
 * buildDocsDB
 * startCompletionServer
Line 20: Line 32:
[wiki:Self:completesearch/GNUBuildSystem How to use the autoconf/automake tools to build and deliver the project.] If you call any of these binaries without parameters you will get usage
info with all the available options.
Line 22: Line 35:
[wiki:Self:completesearch/CMakeBuildSystem How to use CMake to build and deliver the project.] === 2. Input (to be produced by a suitable parser) ===
Line 24: Line 37:
[wiki:Self:completesearch/MinGW Compiling under MinGW] Ínput 1: a file ''<base-name>.words'', with lines of the form
Line 26: Line 39:
{{{
<word><TAB><doc id><TAB><score><TAB><position>
}}}
Line 27: Line 43:
== Specfications == This file must be sorted such that ''sort -c -k1,1 -k2,2n -k4,4n'' does not complain.
Line 29: Line 45:
[wiki:Self:completesearch/ExcerptGenerator Excerpt Generator requirements] Input 2: a file ''<base-name>.docs'', with lines of the form
Line 31: Line 47:
<doc id><TAB>u:<url of document><TAB>t:<title of document><TAB>H:<raw
text of document>
Line 32: Line 50:
== HOWTOs == This file must be sorted so that ''sort -c -k1,1n'' does not complain.
Line 34: Line 52:
[wiki:Self:completesearch/SeleniumRC Testing with SeleniumRC] You find a very simple example under
http://www.mpi-inf.mpg.de/~bast/topsecret/example.tgz
Line 36: Line 55:
[wiki:Self:completesearch/ModPhpStartetExe Apache mit mod_php startet externe Programme unter Windows] === 3. Build the word index ===
Line 38: Line 57:
[wiki:Self:completesearch/CharacterEncoding Character Encoding] {{{
buildIndex HYB <base-name>.words
}}}
Line 40: Line 61:
[wiki:Self:completesearch/Templates Template peculiarities in the Complete``Search code] This produces the (binary) index file ''<base-name>.hybrid''.
It enables fast processing of the powerful query language offered by CompleteSearch (including
full-text search, prefix search and completion, synonym search, error-tolerant search,
etc.).
Line 42: Line 66:
''buildIndex'' also produces the file ''<base-name>.vocabulary'' that provides
the mapping from word ids to words. This is an ASCII file, you can just look at it.
Line 43: Line 69:
== TODOs == Note that by default, the HYB index is built with block of fixed sizes. It is more
efficient though to pass it an explicit list of block boundaries (-B
option). TODO: say something about this here, it's actually quite easy.
Line 45: Line 73:
[wiki:Self:completesearch/TODO TODO list] === 4. Build the doc index ===
Line 47: Line 75:
[wiki:Self:NewFeatures New Features that would be nice to have] {{{
buildDocsDB <name>.docs
}}}
Line 49: Line 79:
This produces the (binar) file ''<base-name>.docs.DB'' which provides an efficient mapping
from doc ids to documents. This is needed if you want to show excerpts / snippets
from documents matching the query (which is almost always the case).
Line 50: Line 83:
== Miscellaneous / Not yet sorted in == === 5. Start server ===
Line 52: Line 85:
[wiki:Self:completesearch/CVSHistory CVS history] {{{
startCompletionServer -Z <base-name>.hybrid
}}}
Line 54: Line 89:
[wiki:Self:completesearch/Examples Example programs etc.] This starts the server. If you run it without argument, it prints usage
information and shows you the (very many) command line options. The ''-Z''
argument lets the server run in the foreground, and
output everything to the console, which is convenient for testing. The default
mode is to run as a background process and write all output to a log file.

=== 6. Queries ===

The server listens on the port you specified in step 6 (''8888'' by
default), and speaks ''HTTP''. For example:

{{{
curl "http://localhost:8888/?q=die*&h=1&c=3"
}}}

This will return the result as an XML, which should be self-explanatory.

Here is the list of parameters which you may pass along with the query
(q=...)

 * h : number of hits
 * c : number of completions (of last query word, if you put a * behind it)
 * f : send hits starting from this one (default: 0)
 * en : number of excerpts per hit
 * er : size of excerpt
 * rd : how to rank the documents (0 = by score, 1 = by doc id, 2 = by word id, append a or d for ascending or descending)
 * rw : how to rank the words (0 = by score, 1 = by doc count, 2 = by occurrence count, 3 = by word id, 4 = by doc id, append a or d as above)
 * s : how to aggregate scores (expert option, ignore for the moment)
 * format : one of xml, json, jsonp. Return result in that format.

CompleteSearch

Old Wiki from the MPII (lots of detailed / internal information)

Quick Intro

Follow these steps to checkout the CompleteSearch code from our SVN, build it, build an index, run a server on that index, and ask queries to that server via HTTP. Don't be afraid, it's easy. If you have questions, send an email to Hannah Bast <bast@informatik.uni-freiburg.de>.

0. Get source code

svn checkout
http://vulcano.informatik.uni-freiburg.de/svn/completesearch/codebase
Username: [ask us]
Password: [ask us]

1. Compile

make all

This will build three binaries:

  • buildIndex
  • buildDocsDB
  • startCompletionServer

If you call any of these binaries without parameters you will get usage info with all the available options.

2. Input (to be produced by a suitable parser)

Ínput 1: a file <base-name>.words, with lines of the form

<word><TAB><doc id><TAB><score><TAB><position>

This file must be sorted such that sort -c -k1,1 -k2,2n -k4,4n does not complain.

Input 2: a file <base-name>.docs, with lines of the form

<doc id><TAB>u:<url of document><TAB>t:<title of document><TAB>H:<raw text of document>

This file must be sorted so that sort -c -k1,1n does not complain.

You find a very simple example under http://www.mpi-inf.mpg.de/~bast/topsecret/example.tgz

3. Build the word index

buildIndex HYB <base-name>.words

This produces the (binary) index file <base-name>.hybrid. It enables fast processing of the powerful query language offered by CompleteSearch (including full-text search, prefix search and completion, synonym search, error-tolerant search, etc.).

buildIndex also produces the file <base-name>.vocabulary that provides the mapping from word ids to words. This is an ASCII file, you can just look at it.

Note that by default, the HYB index is built with block of fixed sizes. It is more efficient though to pass it an explicit list of block boundaries (-B option). TODO: say something about this here, it's actually quite easy.

4. Build the doc index

buildDocsDB <name>.docs

This produces the (binar) file <base-name>.docs.DB which provides an efficient mapping from doc ids to documents. This is needed if you want to show excerpts / snippets from documents matching the query (which is almost always the case).

5. Start server

startCompletionServer -Z <base-name>.hybrid

This starts the server. If you run it without argument, it prints usage information and shows you the (very many) command line options. The -Z argument lets the server run in the foreground, and output everything to the console, which is convenient for testing. The default mode is to run as a background process and write all output to a log file.

6. Queries

The server listens on the port you specified in step 6 (8888 by default), and speaks HTTP. For example:

curl "http://localhost:8888/?q=die*&h=1&c=3"

This will return the result as an XML, which should be self-explanatory.

Here is the list of parameters which you may pass along with the query (q=...)

  • h : number of hits
  • c : number of completions (of last query word, if you put a * behind it)
  • f : send hits starting from this one (default: 0)
  • en : number of excerpts per hit
  • er : size of excerpt
  • rd : how to rank the documents (0 = by score, 1 = by doc id, 2 = by word id, append a or d for ascending or descending)
  • rw : how to rank the words (0 = by score, 1 = by doc count, 2 = by occurrence count, 3 = by word id, 4 = by doc id, append a or d as above)
  • s : how to aggregate scores (expert option, ignore for the moment)
  • format : one of xml, json, jsonp. Return result in that format.

CompleteSearch: FrontPage (last edited 2017-03-19 13:30:19 by Hannah Bast)