| |||||||||||||||||
Programmer's Guide:
|
Property |
Description |
Indicates the first date in a date-constrained search. For example, the date on which an item was created or the first in a series of dates on which an item could have been created. | |
Indicates the second date in a date-constrained search. For example, the last in a series of dates on which an item could have been created. | |
Indicates a date operator for Date1 and Date2 in a date-constrained search. For example, you can search for items created on, before, or after a specified date. | |
Indicates a search string that found items must contain. | |
Indicates the owner of the item for which you want to search. Must be used in conjunction with the Ownership property. | |
Indicates whether to search for items based on Users or Groups who appear in an object's "who can edit" list. | |
Indicates search options. In this release, you can use this property to search for items that are marked as unread. |
The following example searches all Rooms in the Facility for all items that contain the phrase "Release 3.0."
Dim Mgr As New
ERUSvrManager
Dim Facility as IERUFacility Dim Searcher As IERUFacilitySearch
Dim Criteria as IERUSearchCriteria
Dim Items As IERUCollection
Dim Item As IERUItem
Set Facility = Mgr.GetFacility("http://localhost/eroom/fac7",
"user", "password", "", "")
'Get the a Facility Searcher object.
Set Searcher = Facility.Searcher
'Set search criteria to all items that contain the phrase specified by
FindPhrase.
Set Criteria = Searcher
Criteria.KeywordExpression = "Release 3.0"
'Execute the search.
Set Items = Searcher.Execute
The following example searches three specific Rooms for items created by a particular user.
Dim Mgr As New
ERUSvrManager
Dim Facility as IERUFacility
Dim Searcher As IERUFacilitySearch
Dim Criteria as IERUSearchCriteria
Dim Items As IERUCollection
Dim Item As IERUItem
Set Facility = Mgr.GetFacility("http://localhost/eroom/fac7",
"user", "password", "", "")
'Get the Facility Searcher object.
Set Searcher = Facility.Searcher
'Get the rooms we want to search and tell the Facility Searcher
Set Room1 = Mgr.GetRoom("http://localhost/eroom/fac7/room3",
"user", "password", "", "")
Set Room2 = Mgr.GetRoom("http://localhost/eroom/fac7/room4",
"user", "password", "", "")
Searcher.AddRoom(Room1)
Searcher.AddRoom(Room2)
'Set search criteria to all items created by the logged-in user
Set Criteria = Searcher
Criteria.Owner = Facility.LoggedInMember
'Execute the search.
Set Items = Searcher.Execute
The following example searches a Room for all items created earlier than one week ago and deletes them.
Dim SvrManager
As New ERUSvrManager
Dim Room As IERURoom
Dim Searcher As IERURoomSearch
Dim Criteria as IERUSearchCriteria
Dim WeekAgo As Date
Dim Items As IERUCollection
Dim Item As IERUItem
Set Room = SvrManager.GetRoom("http://localhost/eroom/fac7/room1",
"user", "password", "", "")
'Get the Room Searcher object.
Set Searcher = Room.Searcher
'Set search criteria to all Items created before the date specified by
WeekAgo.
WeekAgo = DateAdd("ww", -1, Date)
Set Criteria = Searcher
Criteria.Date1 = WeekAgo
Criteria.DateOp = erDateOperBefore
'Execute the search.
Set Items = Searcher.Execute
'Delete each Item in the returned collection.
For Each Item In Items
Item.Delete
Next
For information on searching for items based on their custom field values, see Using eRoom Custom Fields.