<commit_before>Search plugin for GNU Mediagoblin
###############

|license_badge| |pypi_badge| |version_badge|
|travis_badge| |status_badge|

.. |license_badge| image:: https://img.shields.io/pypi/l/mediagoblin-indexedsearch.svg
   :target: https://en.wikipedia.org/wiki/Affero_General_Public_License

.. |pypi_badge| image:: https://img.shields.io/pypi/v/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. |version_badge| image:: https://img.shields.io/pypi/pyversions/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. |status_badge| image:: https://img.shields.io/pypi/status/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. |travis_badge| image:: https://travis-ci.org/tofay/mediagoblin-indexedsearch.svg?branch=master
   :target: https://travis-ci.org/tofay/mediagoblin-indexedsearch

.. |status_badge| image:: https://img.shields.io/pypi/status/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. END_BADGES_TAG

N.B Only works with unreleased dev version of mediagoblin (0.9.0)

``mediagoblin-indexedsearch`` is a plugin for GNU Mediagoblin that adds support for searching media.

By default, the search function will query the tags, title and description fields
of media for the given phrase.

More complex queries are supported, e.g searching for media with tagged with "hello"
and not tagged with "goodbye" (tag:hello -tag:goodbye), or searching for any
media added by the user "tom" (user:tom).

(See http://whoosh.readthedocs.org/en/latest/querylang.html for more syntax info.)

This plugin is based on an existing search plugin, https://github.com/ayleph/mediagoblin-basicsearch/,
but uses a search index for queries.

.. END_DESCRIPTION_TAG


Setting up the search plugin
===========================

Enable the plugin by adding the following line to the ``[plugins]`` section of your mediagoblin config file.

[[indexedsearch]]
<commit_msg>Update README.rst<commit_after>Search plugin for GNU Mediagoblin
###############

|license_badge| |pypi_badge| |version_badge|
|travis_badge| |status_badge|

.. |license_badge| image:: https://img.shields.io/pypi/l/mediagoblin-indexedsearch.svg
   :target: https://en.wikipedia.org/wiki/Affero_General_Public_License

.. |pypi_badge| image:: https://img.shields.io/pypi/v/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. |version_badge| image:: https://img.shields.io/pypi/pyversions/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. |status_badge| image:: https://img.shields.io/pypi/status/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. |travis_badge| image:: https://travis-ci.org/tofay/mediagoblin-indexedsearch.svg?branch=master
   :target: https://travis-ci.org/tofay/mediagoblin-indexedsearch

.. |status_badge| image:: https://img.shields.io/pypi/status/mediagoblin-indexedsearch.svg
   :target: https://pypi.python.org/pypi/mediagoblin-indexedsearch

.. END_BADGES_TAG

N.B Only works with unreleased dev version of mediagoblin (0.9.0)

``mediagoblin-indexedsearch`` is a plugin for GNU Mediagoblin that adds support for searching media.

By default, the search function will query the tags, title and description fields
of media for the given phrase.

More complex queries are supported, e.g searching for media with tagged with "hello"
and not tagged with "goodbye" (tag:hello -tag:goodbye), or searching for any
media added by the user "tom" (user:tom).

(See http://whoosh.readthedocs.org/en/latest/querylang.html for more syntax info.)

This plugin is based on an existing search plugin, https://github.com/ayleph/mediagoblin-basicsearch/,
but uses a search index for queries.

.. END_DESCRIPTION_TAG


Setting up the search plugin
===========================

Checkout this repository with::

   git clone https://github.com/tofay/mediagoblin-indexedsearch.git

Then install the plugin into your virtualenv for mediagoblin::

   cd mediagoblin-indexedsearch/
   /path/to/mediagoblin/bin/python setup.py install


Enable the plugin by adding the following line to the ``[plugins]`` section of your mediagoblin config file.

[[indexedsearch]]

{'fraction_non_alphanumeric': 0.1334401464866102, 'fraction_numerical': 0.001373311970702678, 'mean_word_length': 4.881561238223418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 27, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7334205', 'n_tokens_mistral': 1514, 'n_tokens_neox': 1467, 'n_words': 344}