diff options
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index ff31e487..4cab66ec 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -14,13 +14,9 @@ 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=30) + query = ["&","&",("type","=","product"),("active","=",True),"|",("solr_flag","=",0),("solr_flag","=",2)] - templates = self.env['product.template'].search([ - ('solr_flag', '=', 0), - ('type', '=', 'product'), - ('active', '=', True) - # ('id', '=', 21560) - ], limit=500) + templates = self.env['product.template'].search(query, limit=500) document = [] counter = 0 for template in templates: |
