]> git.parisson.com Git - telemeta.git/commitdiff
Fix build_query for query with punctuations
authormathieu <mathieu.boye28@gmail.com>
Mon, 2 May 2016 08:27:49 +0000 (10:27 +0200)
committermathieu <mathieu.boye28@gmail.com>
Mon, 2 May 2016 08:27:49 +0000 (10:27 +0200)
env/debug.env
telemeta/util/backend.py

index 7a9fbbcc2efd668f22107e8e9316a87bd0755b0f..a19e34770877c2c4104fc1cee497ee521afd6e88 100644 (file)
@@ -18,4 +18,4 @@ BROKER_URL=redis://broker:6379/0
 # If this is True, all tasks will be executed locally by blocking until the task returns.
 CELERY_ALWAYS_EAGER=False
 
-REINDEX=True
+REINDEX=False
index 3db02c1e4068087024a5c53aa39773a5c879a452..c2f77577450cbe89f9261b22a6d10c35f2ec7faf 100644 (file)
@@ -21,13 +21,17 @@ class CustomElasticBackend(ElasticsearchSearchBackend):
         eb.setup()
 
 
-import unicodedata#
-class CustomElasticSearchQuery(ElasticsearchSearchQuery):#
+import unicodedata
+import sys
+class CustomElasticSearchQuery(ElasticsearchSearchQuery):
 
     def build_query_fragment(self, field, filter_type, value):
+        value = re.sub(regexSpacePunc, " ", value)
         print("Query fragment :"+ field+ ' '+ filter_type+ ' '+ value)
+        sys.stdout.flush()
         valeur = super(CustomElasticSearchQuery, self).build_query_fragment(field, filter_type, value)
         print("Query fragment result "+ valeur)
+        sys.stdout.flush()
         return valeur
 
     def build_query(self):