Skip to main content
Jump to: navigation, search

Difference between revisions of "Search CVS"

m (Parameter List)
(add setup notes)
Line 1: Line 1:
=Search CVS=
+
==User Guide==
 
+
==User Documentation==
+
  
 
There are two basic components to the query syntax of [http://www.eclipse.org/emf/searchcvs.php Search CVS], a phrase (consisting of one or more words), and a set of zero or more parameters. These both need a little more explanation to understand their full power.
 
There are two basic components to the query syntax of [http://www.eclipse.org/emf/searchcvs.php Search CVS], a phrase (consisting of one or more words), and a set of zero or more parameters. These both need a little more explanation to understand their full power.
Line 82: Line 80:
  
 
At least one word or parameter must be entered to perform a search, otherwise there are no arbitrary restrictions or limits.
 
At least one word or parameter must be entered to perform a search, otherwise there are no arbitrary restrictions or limits.
 +
 +
==Setup==
 +
 +
===Backend===
 +
 +
Search CVS requires MySQL 5.0 and PHP 4.3 (or higher) with mysql and pcre support.
 +
 +
The parsing code can be found at :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse in org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/scripts_cvs/searchcvs under the releng_test tag (it is not present in HEAD as of this writing).
 +
 +
In the directory you checked out the parsing code to, you should find a cvssrc/ directory. Check out all projects you would like to index into this directory. setup.sh can be used to check projects out into this directory, though you will probably want to change the projects it checks out. Alternatively, you can check projects out into cvssrc/ manually.
 +
 +
You will now need to import the two MySQL dump files to create the database schema and add the necessary users. Before doing this, you will likely want to change the usernames and passwords as well as the database name. The first user has full permissions on the database and is the user that will be used when parsing the CVS logs. The second user is used for the web page and has read only permissions. Once you have made these changes, import the dumps into MySQL:
 +
mysql -u root -p <mysql-modelingschema.dump
 +
mysql -u root -p <mysql-users.dump
 +
Also update the parsecvs-dbaccess.php file and searchcvs-dbaccess.php files so that they contain the correct credentials as you just set in the dump files.
 +
 +
Now that the database is ready, you can run parsecvs.sh which will populate the database using the CVS logs of the checked out projects. parsecvs.sh expects be in the same directory as parsecvs.php and cvssrc/. You will probably want to have parsecvs.sh run as a nightly cron job. Place something like so:
 +
00 22 * * * $HOME/searchcvs/parsecvs.sh &> $HOME/searchcvs/parsecvs.log
 +
in your crontab to run parsecvs.sh every night at 10 pm.
 +
 +
===Web===
 +
 +
The latest copy of the web frontend can be found at :pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse in www/emf, you will need searchcvs.php, includes/searchcvs.css, and includes/db.php.
 +
 +
Place searchcvs.php, includes/searchcvs.css, and includes/db.php into your web directory. Ask your friendly Eclipse webmaster to place the searchcvs-dbaccess.php (from above) file directly into your web directory on www.eclipse.org, such that it is not checked into CVS.
 +
 +
You should now be able to use the Search CVS application on your website for your project(s).

Revision as of 15:50, 8 September 2006

User Guide

There are two basic components to the query syntax of Search CVS, a phrase (consisting of one or more words), and a set of zero or more parameters. These both need a little more explanation to understand their full power.

The Phrase

Search CVS searches through the messages of each commit, looking for matching words in commit messages. Only the message field is matched against the phrase, if you would like to narrow down the search further, use one or more parameters (see below). The syntax for the phrase is simply a set of one or more words.

Matching the phrase is done using MySQL's fulltext indexing. This splits the phrase into words and then searches for occurances of each word, assigning a relevance value based on the number of matches. Once a set of results is found, the results are sorted according to the relevance value and then in chronological order.

MySQL's fulltext indexing is relatively sophisticated, but most of the details aren't essential to know, with one exception. That exception is the fact that MySQL's fulltext indexing does not index words that are shorter than a set number of characters (4 by default), thus if you attempt to search for a word that is shorter than that set number of characters, you won't get any results. In other words, using the default settings, both of these queries:

hello emf

and

hello

would return the same results, and a query of

emf

would return no results.

There is one other option for the phrase, and that is a quoted phrase. If you search for

"hello world"

only results with exactly the word 'hello' immediately followed by a space and then 'world' will be returned (technical note: this kicks the entire match into boolean mode), whereas searching for

hello world

would return results with both words as well as just one of the words. When searching for quoted phrases, the relevance value becomes a boolean and only indicates if a match was found or not, saying nothing about the quality of the match. Effectively, this means that the results will only be sorted chronologically for quoted phrases. Also note that the minimum character length also applies to quoted phrases, such that

"emf emf"

will return no results, but

"hello emf"

will return the expected results.

There is one exception to the above, if you enter only a bug number (with or without square braces, but nothing else), you will only be presented with the changes associated with that bug.

The Parameters

Parameters can be used to further narrow down the set of results, their syntax consists of a keyword followed by a colon, followed by the search term (with an optional space between the colon and search term), for example:

author: emerks

Different keywords can be combined provided that they are separated by whitespace. For example:

days: 200 author: emerks

will find all commits by 'emerks' within the last 200 days.

In the case of duplicate parameters, only the last parameter will be used. For example:

author: emerks author: nickb

will only search for commits made by 'nickb'.

With the exception of the days and project/module keywords, the search terms are treated as substrings, meaning that a query of

author: merks

will find all commits by 'emerks' as well as anyone else with 'merks' in their committer name.

Parameter List

A complete list of parameters along with an example and brief description follows:

Parameter Example Description
author author: merks restrict search to only this author (will match partial names)
branch branch: R2_1_ restrict search to commits from this branch (will match partial names)
days days: 7 restrict search to commits made in the last N days
file file: org.eclipse.emf/ restrict search to files matching this substring
project or module project: org.eclipse.xsd

module: org.eclipse.xsd

restrict search to commits in this cvs module (or project)

Restrictions

At least one word or parameter must be entered to perform a search, otherwise there are no arbitrary restrictions or limits.

Setup

Backend

Search CVS requires MySQL 5.0 and PHP 4.3 (or higher) with mysql and pcre support.

The parsing code can be found at :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse in org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/scripts_cvs/searchcvs under the releng_test tag (it is not present in HEAD as of this writing).

In the directory you checked out the parsing code to, you should find a cvssrc/ directory. Check out all projects you would like to index into this directory. setup.sh can be used to check projects out into this directory, though you will probably want to change the projects it checks out. Alternatively, you can check projects out into cvssrc/ manually.

You will now need to import the two MySQL dump files to create the database schema and add the necessary users. Before doing this, you will likely want to change the usernames and passwords as well as the database name. The first user has full permissions on the database and is the user that will be used when parsing the CVS logs. The second user is used for the web page and has read only permissions. Once you have made these changes, import the dumps into MySQL:

mysql -u root -p <mysql-modelingschema.dump
mysql -u root -p <mysql-users.dump

Also update the parsecvs-dbaccess.php file and searchcvs-dbaccess.php files so that they contain the correct credentials as you just set in the dump files.

Now that the database is ready, you can run parsecvs.sh which will populate the database using the CVS logs of the checked out projects. parsecvs.sh expects be in the same directory as parsecvs.php and cvssrc/. You will probably want to have parsecvs.sh run as a nightly cron job. Place something like so:

00 22 * * * $HOME/searchcvs/parsecvs.sh &> $HOME/searchcvs/parsecvs.log

in your crontab to run parsecvs.sh every night at 10 pm.

Web

The latest copy of the web frontend can be found at :pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse in www/emf, you will need searchcvs.php, includes/searchcvs.css, and includes/db.php.

Place searchcvs.php, includes/searchcvs.css, and includes/db.php into your web directory. Ask your friendly Eclipse webmaster to place the searchcvs-dbaccess.php (from above) file directly into your web directory on www.eclipse.org, such that it is not checked into CVS.

You should now be able to use the Search CVS application on your website for your project(s).

Back to the top