diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-03-30 09:47:07 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-03-30 09:47:07 +0700 |
| commit | a7c5bef3987edb8bab1fce6219d9bfdce1fc65af (patch) | |
| tree | 85aa6cd3609c38ff909e29632c0e33ab0c9d6385 | |
| parent | 83c8767e007d83e155c637f94768481a8f35e40c (diff) | |
only active product for solr
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index 1f84e252..50f3d8f1 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -13,11 +13,12 @@ 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/', always_commit=True, timeout=100) + solr = pysolr.Solr('http://192.168.23.5:8983/solr/product/', always_commit=True, timeout=100) templates = self.env['product.template'].search([ ('solr_flag', '=', 0), - ('type', '=', 'product') + ('type', '=', 'product'), + ('active', '=', True) # ('id', '=', 21560) ], limit=500) document = [] @@ -62,8 +63,7 @@ class ApacheSolr(models.Model): 'variants_name_t': variants_name, 'variants_code_t': variants_code, 'search_rank_i': template.search_rank, - 'search_rank_weekly_i': template.search_rank_weekly, - 'active_b': template.active + 'search_rank_weekly_i': template.search_rank_weekly })] solr.add(document) template.solr_flag = 1 |
