<commit_before>--------
## Docstore Scope :
--------

Docstore is a collection of IATI activities documents contents. Those docs are associated into IATI activities by the publishers.

For more details about the documents content, it is highly recommended to look at the IATI standard reference:

http://iatistandard.org/202/activity-standard/iati-activities/iati-activity/document-link/

OIPA is a building a search engine named "Docstore" that is collecting docs published in IATI activities. It is offering a word look up and generating a list of documents that is matching users queries.

--------
## Docstore Data Loading and Indexing :
--------
The Docstore Data can be loaded through the OIPA queue admin interface. The task responsible to load the data under "Document Tasks": "Collect Documents".

After adding the docstore task and its execution. The OIPA docstore is containing the whole pdf documents associated to the available OIPA activities.

The docstore documents indexation can be performed by using the command line:

'
./manage.py update_ft_indexes_documents
'


--------
## Docstore API Usage
--------

The docstore API endpoint is available under :

http://localhost:8000/api/documents/

The Docstore search can be performed using the following query params:

http://localhost:8000/api/documents/?document_q="aids"<commit_msg>add API results format<commit_after>--------
## Docstore Scope :
--------

Docstore is a collection of IATI activities documents contents. Those docs are associated into IATI activities by the publishers.

For more details about the documents content, it is highly recommended to look at the IATI standard reference:

http://iatistandard.org/202/activity-standard/iati-activities/iati-activity/document-link/

OIPA is a building a search engine named "Docstore" that is collecting docs published in IATI activities. It is offering a word look up and generating a list of documents that is matching users queries.

--------
## Docstore Data Loading and Indexing :
--------
The Docstore Data can be loaded through the OIPA queue admin interface. The task responsible to load the data under "Document Tasks": "Collect Documents".

After adding the docstore task and its execution. The OIPA docstore is containing the whole pdf documents associated to the available OIPA activities.

The docstore documents indexation can be performed by using the command line:

'
./manage.py update_ft_indexes_documents
'


--------
## Docstore API Usage
--------

The docstore API endpoint is available under :

http://localhost:8000/api/documents/

The Docstore search can be performed using the following query params:

http://localhost:8000/api/documents/?document_q="aids"

As output results, it is returned for instance:

"results": [
{
    "id": 5,
    "document_name": "actionaid_trustees_report_and_accounts_2014.pdf",
    "long_url": "https://www.actionaid.org.uk/sites/default/files/actionaid_trustees_report_and_accounts_2014.pdf"
}]
{'fraction_non_alphanumeric': 0.09008403361344537, 'fraction_numerical': 0.010420168067226891, 'mean_word_length': 4.018549747048904, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '2434961', 'n_tokens_mistral': 816, 'n_tokens_neox': 765, 'n_words': 347}