Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.3 KiB

  1. TYPES OF RESTRICTIONS
  2. 1) Content Restriction
  3. Input: <property>, <text>, <fuzzy level>
  4. Matches documents which contain <text> in <property>.
  5. <property> may be any textual Ole property or a special property. The
  6. special properties include CONTENTS (the main body of the document), ALL
  7. (search all properties), and user-defined PSEUDO-PROPERTIES (text
  8. distinguished for purposes of content search).
  9. <fuzzy level> describes how exactly <text> has to match the document.
  10. Fuzzy level 0 is exact match. Fuzzy level 1 is prefix match (each word
  11. is treated as a prefix). Fuzzy level 2 is morphological stemming (run
  12. would match run, running, ran, etc.)
  13. The result of a content query may be out-of-date.
  14. 2) Property Restriction
  15. Input: <property>, <relop>, <value>
  16. Matches documents where <property> <relop> <value>.
  17. <property> must be a true Ole property, or a few special properties that
  18. are valid only in query results. The special properties are RANK (how
  19. well the restriction matches the object), HITCOUNT (number of content
  20. index 'hits'), and RANK VECTOR (for use with vector restriction)
  21. <relop> is one of: <, <=, =, !=, >=, >, SOME OF, and ALL OF. The last
  22. two are bitwise operations valid only for integer types. In C++ syntax,
  23. SOME OF is (<property> & <value>) != 0, and ALL OF is (<property> &
  24. <value>) == <value>.
  25. <value> is a STGVARIANT.
  26. The result of a property query always reflects the last saved state of
  27. all objects.
  28. TYPES OF INDEXES
  29. 1) Content Index
  30. The content index is a mapping of <property>,<words> back to the
  31. documents which contain <words> in <property>.
  32. There is no scoping within the content index.
  33. The content index is lazily updated. It may be out-of-date.
  34. 2) Value Index
  35. A value index is a mapping from <property>,<range of values> back to the
  36. documents which have a value within <range of values> for the
  37. <property>.
  38. In other words, the possible range of values for a data type
  39. (VT_FILETIME, VT_I4, etc) is divided into "buckets". Every possible
  40. value falls into one of these buckets. Note that the mapping is from
  41. bucket to document, not value to document. A search for SIZE == 500
  42. might map to a bucket from 250 to 525. So the result of index lookup
  43. would be all files from SIZE 250 to 525, not just those having SIZE ==
  44. 500.
  45. There is no scoping within a value index.
  46. Value indices can be used in conjunction with content index. They are
  47. lazily updated with the same frequency as content index.
  48. There is no administration necessary to set up value indices. All
  49. properties are value indexed except a few hard-coded exceptions. This
  50. may change in the future.
  51. 3) View Index
  52. A view index is a B-Tree. It contains a complete sorted list of files
  53. for a single directory. Besides key columns, the view can contain
  54. additional unsorted columns. These improve retrieval efficiency but
  55. have less effect on query efficiency.
  56. View indices must be created by an administrator.
  57. 4) Directory Index
  58. Listed for completeness. This is a view index on the filename property.
  59. It is always available.
  60. RULES FOR MATCHING QUERY WITH INDEX (in order of precedence)
  61. 1) If a query contains a content restriction, use content index, adding
  62. value indices if appropriate.
  63. 2) If one or more properties of a property restriction are used in the
  64. sort order of a view index, and the query is shallow, then use view
  65. index.
  66. Note that properties of the view must be used in order. A view on SIZE
  67. and FILENAME could be used for queries involving SIZE, and queries
  68. involving both SIZE and FILENAME, but not for queries involving just
  69. FILENAME.
  70. If more than one view is applicable, then the view in which the most
  71. keys of the sort appear in the restriction is used. Thus given two
  72. views: SIZE, FILENAME and SIZE, ATTRIBUTES, a query for SIZE and
  73. FILENAME would use the former.
  74. 3) If one or more properties of a property restriction is value indexed,
  75. and the value index is reasonably up-to-date, and the query is
  76. shallow, then use value indexing.
  77. 4) If 1, 2, and 3 do not apply, or if the volume is downlevel (not Ofs),
  78. then use the directory index (e.g. enumeration).