<commit_before># -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()

import re
import sys
from ConfigParser import ConfigParser
from flask import Flask, request, jsonify, abort

from openprocurement.search.index.auction import AuctionIndex
from openprocurement.search.index.tender import TenderIndex
from openprocurement.search.index.ocds import OcdsIndex
from openprocurement.search.index.plan import PlanIndex
from openprocurement.search.index.orgs import OrgsIndex

from openprocurement.search.engine import SearchEngine

# create Flask app

search_server = Flask(__name__)
search_server.config.from_object(__name__)

# load config

config_parser = ConfigParser()
for arg in sys.argv:
    if arg.endswith('.ini'):
        config_parser.read(arg)
search_config = dict(config_parser.items('search_engine'))

# create engine

search_engine = SearchEngine(search_config)
search_engine.init_search_map({
    'auctions': [AuctionIndex],
    'tenders': [TenderIndex, OcdsIndex],
    'plans': [PlanIndex],
    'orgs': [OrgsIndex],
})

# query fileds map
<commit_msg>search_server disable jsonify debug (prettry print)<commit_after># -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()

import re
import sys
from ConfigParser import ConfigParser
from flask import Flask, request, jsonify, abort

from openprocurement.search.index.auction import AuctionIndex
from openprocurement.search.index.tender import TenderIndex
from openprocurement.search.index.ocds import OcdsIndex
from openprocurement.search.index.plan import PlanIndex
from openprocurement.search.index.orgs import OrgsIndex

from openprocurement.search.engine import SearchEngine

# Flas config

JSONIFY_PRETTYPRINT_REGULAR = False

# create Flask app

search_server = Flask(__name__)
search_server.config.from_object(__name__)

# load config

config_parser = ConfigParser()
for arg in sys.argv:
    if arg.endswith('.ini'):
        config_parser.read(arg)
search_config = dict(config_parser.items('search_engine'))

# create engine

search_engine = SearchEngine(search_config)
search_engine.init_search_map({
    'auctions': [AuctionIndex],
    'tenders': [TenderIndex, OcdsIndex],
    'plans': [PlanIndex],
    'orgs': [OrgsIndex],
})

# query fileds map

{'fraction_non_alphanumeric': 0.09269162210338681, 'fraction_numerical': 0.00089126559714795, 'mean_word_length': 5.602941176470588, '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': '5817324', 'n_tokens_mistral': 704, 'n_tokens_neox': 694, 'n_words': 175}