Files @ caef0be39948
Branch filter:

Location: kallithea/docs/index.rst

caef0be39948 1.2 KiB text/prs.fallenstein.rst Show Annotation Show as Raw Download as Raw
FUJIWARA Katsunori
search: make "repository:" condition work as expected

Before this revision, "repository:foo" condition at searching for
"File contents" or "File names" shows files in repositories below.

- foo
- foo/bar
- foo-bar
- and so on ...

Whoosh library, which is used to parse text for indexing and seaching,
does:

- treat almost all non-alphanumeric characters as delimiter both at
indexing search items and at parsing search condition
- make each fields for a search item be indexed by multiple values

For example, files in "foo/bar" repository are indexed by "foo" and
"bar" in "repository" field. This tokenization make "repository:foo"
search condition match against files in "foo/bar" repository, too.

In addition to it, using plain TEXT also causes unintentional
ignorance of "stop words" in search conditions. For example, "this",
"a", "you", and so on are ignored at indexing and parsing, because
these are too generic words (from point of view of generic "text
search").

This issue can't be resolved by using ID instead of TEXT for
"repository" of SCHEMA, like as previous revisions for JOURNAL_SCHEMA,
because:

- highlight-ing file content requires SCHEMA to support "positions"
feature, but using ID instead of TEXT disables it
- using ID violates current case-insensitive search policy, because
it preserves case of text

To make "repository:" condition work as expected, this revision
explicitly specifies "analyzer", which does:

- avoid tokenization
- match case-insensitively
- avoid removing "stop words" from text

This revision requires full re-building index tables, because indexing
schema is changed.

BTW, "repository:" condition at searching for "Commit messages" uses
CHGSETS_SCHEMA instead of SCHEMA. The former uses ID for "repository",
and it does:

- avoid issues by tokenization and removing "stop words"

- disable "positions" feature of CHGSETS_SCHEMA

But highlight-ing file content isn't needed at searching for
"Commit messages". Therefore, this can be ignored.

- preserve case of text

This violates current case-insensitive search policy, This issue
will be fixed by subsequent revision, because fixing it isn't so
simple.
.. _index:

#######################
Kallithea Documentation
#######################

**Readme**

.. toctree::
   :maxdepth: 1

   readme

**Installation**

.. toctree::
   :maxdepth: 1

   overview
   installation
   installation_win
   installation_win_old
   installation_iis
   setup
   installation_puppet
   upgrade

**Usage**

.. toctree::
   :maxdepth: 1

   usage/general
   usage/vcs_support
   usage/locking
   usage/statistics

**Administrator's guide**

.. toctree::
   :maxdepth: 1

   usage/email
   usage/performance
   usage/backup
   usage/debugging
   usage/troubleshooting
   usage/customization

**Development**

.. toctree::
   :maxdepth: 1

   contributing
   dev/translation
   dev/dbmigrations

**API**

.. toctree::
   :maxdepth: 1

   api/api


Other topics
************

* :ref:`genindex`
* :ref:`search`


.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _python: http://www.python.org/
.. _django: http://www.djangoproject.com/
.. _mercurial: https://www.mercurial-scm.org/
.. _bitbucket: http://bitbucket.org/
.. _subversion: http://subversion.tigris.org/
.. _git: http://git-scm.com/
.. _celery: http://celeryproject.org/
.. _Sphinx: http://sphinx.pocoo.org/
.. _vcs: http://pypi.python.org/pypi/vcs