<commit_before># thor
\- a stupid name for an App Engine search API wrapper.

thor is a wrapper for Google App Engine's search API that uses Django-like syntax for defining documents, and serching and filtering search indexes. And this, is it's potentially condescending readme.

## Example

### Searching films

Say your app has a database of films that needs to be searched. The first step is to define a document class describing the searchable film data:

```python
from thor import indexes, fields

class FilmDocument(indexes.DocumentModel):
    title = fields.TextField()
    description = fields.TextField()
    rating = fields.FloatField()
    released = fields.DateField()
```

To index a film document, instantiate and populate it with data, and then add it to thor's provided `Index` class. It's more likely the data would come from some other source (datastore, database, etc.) but for this example we hand-craft it:

```python<commit_msg>Fix some silly typos<commit_after># thor
\- a stupid name for an App Engine search API wrapper.

thor is a wrapper for Google App Engine's search API that uses Django-like syntax for defining documents, and searching and filtering search indexes.

## Example

### Searching films

Say your app has a database of films that needs to be searched. The first step is to define a document class describing the searchable film data:

```python
from thor import indexes, fields

class FilmDocument(indexes.DocumentModel):
    title = fields.TextField()
    description = fields.TextField()
    rating = fields.FloatField()
    released = fields.DateField()
```

To index a film document, instantiate and populate it with data, and then add it to thor's provided `Index` class. It's more likely the data would come from some other source (datastore, database, etc.) but for this example we hand-craft it:

```python
{'fraction_non_alphanumeric': 0.06835306781485469, 'fraction_numerical': 0.0, 'mean_word_length': 4.341954022988506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5656801', 'n_tokens_mistral': 490, 'n_tokens_neox': 454, 'n_words': 255}