void SearchDatabase()
    {
        ReadOnlyTransaction t = db.StartReadWriteTransaction();

        DateTime start  = DateTime.Now;
        int      nBooks = nAuthors * nBooksPerAutor / nCoauthors;

        for (int i = 0, j = 0; i < nBooks; i++)
        {
            // find authors of the book
            Item[] authors = Enumerable.ToArray(t.Find(Predicate.Value("-author").In(Predicate.Value("title") == GenerateTitle(i))));
            Debug.Assert(authors.Length == nCoauthors);
            for (int k = 0; k < nCoauthors; k++)
            {
                Debug.Assert(authors[k].GetString("name") == GenerateName(j++ % nAuthors));
            }
        }
        for (int i = 0; i < nAuthors; i++)
        {
            // find book written by this author
            Item[] books = Enumerable.ToArray(t.Find(Predicate.Value("author").In(Predicate.Value("name") == GenerateName(i))));
            Debug.Assert(books.Length == nBooksPerAutor);
        }
        Console.WriteLine("Elapsed time for searching database " + (DateTime.Now - start));

        start = DateTime.Now;
        for (int i = 0, mask = 0; i < nBooks; i++, mask = ~mask)
        {
            // find book using full text search part of book title and ISDN
            FullTextSearchResult result = t.FullTextSearch(GenerateWord(i ^ mask) + " " + GenerateISBN(i), MAX_FULL_TEXT_SEARCH_RESULTS, MAX_FULL_TEXT_SEARCH_TIME);
            Debug.Assert(result.Hits.Length == 1);
        }
        for (int i = 0, mask = 0; i < nAuthors; i++, mask = ~mask)
        {
            // find authors using full text search of author's name
            FullTextSearchResult result = t.FullTextSearch(GenerateName(i ^ mask), MAX_FULL_TEXT_SEARCH_RESULTS, MAX_FULL_TEXT_SEARCH_TIME);
            Debug.Assert(result.Hits.Length == 1);
        }
        Console.WriteLine("Elapsed time for full text search " + (DateTime.Now - start));

        t.Commit();
    }