Package Products :: Package ZenUtils :: Module Search
[hide private]
[frames] | no frames]

Source Code for Module Products.ZenUtils.Search

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2007, Zenoss Inc. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify it 
 7  # under the terms of the GNU General Public License version 2 as published by 
 8  # the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13   
14  __doc__="""Search 
15   
16  Utilities to help build zcatalog indexes 
17  """ 
18   
19  __version__ = "$Revision: 1.3 $"[11:-2] 
20   
21  from Products.ManagableIndex import FieldIndex, KeywordIndex 
22  from Products.ZenUtils.ExtendedPathIndex import ExtendedPathIndex 
23  from Products.ZenUtils.MultiPathIndex import MultiPathIndex 
24   
25 -def makeCaseInsensitiveFieldIndex(indexName, termType='ustring'):
26 index = FieldIndex(indexName) 27 index.PrenormalizeTerm = 'value/lower' 28 index.TermType = termType 29 return index
30
31 -def makeCaseInsensitiveKeywordIndex(indexName):
32 index = KeywordIndex(indexName) 33 index.PrenormalizeTerm = 'value/lower' 34 index.TermType = 'ustring' 35 index.TermTypeExtra = 'latin-1' 36 return index
37
38 -def makeCaseSensitiveKeywordIndex(indexName):
39 index = KeywordIndex(indexName) 40 index.TermType = 'ustring' 41 index.TermTypeExtra = 'latin-1' 42 return index
43
44 -def makeCaseSensitiveFieldIndex(indexName):
45 index = FieldIndex(indexName) 46 index.TermType = 'ustring' 47 return index
48
49 -def makeFieldIndex(indexName):
50 return makeCaseInsensitiveFieldIndex(indexName)
51
52 -def makeKeywordIndex(indexName):
53 return makeCaseInsensitiveKeywordIndex(indexName)
54
55 -def makePathIndex(indexName):
56 __pychecker__="no-abstract" 57 return ExtendedPathIndex(indexName)
58
59 -def makeMultiPathIndex(indexName):
60 return MultiPathIndex(indexName)
61