summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-03-30 09:33:01 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-03-30 09:33:01 +0700
commit83c8767e007d83e155c637f94768481a8f35e40c (patch)
treecc5c1acf24c9ee16f66621af4e73683decfe1266
parenta9c617802edec9feb01a4bc8baf09b68e39df6d8 (diff)
add always commit and add filter product only
-rw-r--r--indoteknik_custom/models/apache_solr.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py
index 65e875cc..1f84e252 100644
--- a/indoteknik_custom/models/apache_solr.py
+++ b/indoteknik_custom/models/apache_solr.py
@@ -13,10 +13,11 @@ class ApacheSolr(models.Model):
def _sync_product_to_solr(self):
_logger.info('run sync to solr...')
- solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', timeout=100)
+ solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', always_commit=True, timeout=100)
templates = self.env['product.template'].search([
('solr_flag', '=', 0),
+ ('type', '=', 'product')
# ('id', '=', 21560)
], limit=500)
document = []