Esempio n. 1
0
 def testConfigureOrdinalsCache(self):
     settings = LuceneSettings(cacheFacetOrdinals=False)
     soll = copy(DEFAULTS)
     soll['cacheFacetOrdinals'] = False
     ist = settings.asPostDict()
     self.assertEquals(soll.keys(), ist.keys())
     self.assertEquals(soll, ist)
Esempio n. 2
0
 def testConfigureMergePolicy(self):
     settings = LuceneSettings(mergePolicy={'type':'LogDocMergePolicy',
         'mergeFactor': 2,
         'maxMergeDocs': 100})
     soll = copy(DEFAULTS)
     soll['mergePolicy'] = dict(type='LogDocMergePolicy', mergeFactor=2, maxMergeDocs=100)
     ist = settings.asPostDict()
     self.assertEquals(soll, ist)
Esempio n. 3
0
 def testPostDictWithDrilldownFields(self):
     fieldRegistry = FieldRegistry()
     fieldRegistry.registerDrilldownField("field0", hierarchical=True, multiValued=False)
     fieldRegistry.registerDrilldownField("field1", hierarchical=True, multiValued=True, indexFieldName="$facets_2")
     settings = LuceneSettings(fieldRegistry=fieldRegistry)
     soll = copy(DEFAULTS)
     soll['drilldownFields'] = [
         {'dim': 'field0', 'hierarchical': True, 'fieldname': None, 'multiValued': False},
         {'dim': 'field1', 'hierarchical': True, 'fieldname': '$facets_2', 'multiValued': True}]
     self.assertEquals(soll, settings.asPostDict())
Esempio n. 4
0
 def testConfigureMergePolicy(self):
     settings = LuceneSettings(mergePolicy={
         'type': 'LogDocMergePolicy',
         'mergeFactor': 2,
         'maxMergeDocs': 100
     })
     soll = copy(DEFAULTS)
     soll['mergePolicy'] = dict(type='LogDocMergePolicy',
                                mergeFactor=2,
                                maxMergeDocs=100)
     ist = settings.asPostDict()
     self.assertEquals(soll, ist)
 def testAsPostDict(self):
     settings = LuceneSettings()
     self.assertEqual({
             'lruTaxonomyWriterCacheSize': 4000,
             'maxMergeAtOnce': 2,
             'similarity': {'type': 'BM25Similarity'},
             'numberOfConcurrentTasks': 6,
             'segmentsPerTier': 8.0,
             'analyzer': {'type': 'MerescoStandardAnalyzer'},
             'drilldownFields': [],
             'commitCount': 100000,
             'commitTimeout': 10
         }, settings.asPostDict())
 def testPostDictWithDrilldownFields(self):
     fieldRegistry = FieldRegistry()
     fieldRegistry.registerDrilldownField("field0", hierarchical=True, multiValued=False)
     fieldRegistry.registerDrilldownField("field1", hierarchical=True, multiValued=True, indexFieldName="$facets_2")
     settings = LuceneSettings(fieldRegistry=fieldRegistry)
     self.assertEqual({
             'lruTaxonomyWriterCacheSize': 4000,
             'maxMergeAtOnce': 2,
             'similarity': {'type': 'BM25Similarity'},
             'numberOfConcurrentTasks': 6,
             'segmentsPerTier': 8.0,
             'analyzer': {'type': 'MerescoStandardAnalyzer'},
             'drilldownFields': [
                 {'dim': 'field0', 'hierarchical': True, 'fieldname': None, 'multiValued': False},
                 {'dim': 'field1', 'hierarchical': True, 'fieldname': '$facets_2', 'multiValued': True}],
             'commitCount': 100000,
             'commitTimeout': 10
         }, settings.asPostDict())
Esempio n. 7
0
 def testPostDictWithDrilldownFields(self):
     fieldRegistry = FieldRegistry()
     fieldRegistry.registerDrilldownField("field0",
                                          hierarchical=True,
                                          multiValued=False)
     fieldRegistry.registerDrilldownField("field1",
                                          hierarchical=True,
                                          multiValued=True,
                                          indexFieldName="$facets_2")
     settings = LuceneSettings(fieldRegistry=fieldRegistry)
     soll = copy(DEFAULTS)
     soll['drilldownFields'] = [{
         'dim': 'field0',
         'hierarchical': True,
         'fieldname': None,
         'multiValued': False
     }, {
         'dim': 'field1',
         'hierarchical': True,
         'fieldname': '$facets_2',
         'multiValued': True
     }]
     self.assertEquals(soll, settings.asPostDict())
Esempio n. 8
0
 def testAsPostDict(self):
     settings = LuceneSettings()
     self.assertEquals(DEFAULTS, settings.asPostDict())
Esempio n. 9
0
 def testConfigureOrdinalsCache(self):
     settings = LuceneSettings(cacheFacetOrdinals=False)
     soll = copy(DEFAULTS)
     soll['cacheFacetOrdinals'] = False
     ist = settings.asPostDict()
     self.assertEquals(soll, ist)
Esempio n. 10
0
 def testAsPostDict(self):
     settings = LuceneSettings()
     self.assertEquals(DEFAULTS, settings.asPostDict())