You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adding search doc column to at_physical_location (#123)
* adding search doc column to at_physical_location
this will allow an Oracle Text index to be used and then allow fast search using CONTAINS within CDA queries for text search
CONSTRAINT AT_PHYSICAL_LOCATION_PK PRIMARY KEY (LOCATION_CODE) USING INDEX
244
245
)
245
246
TABLESPACE CWMS_20AT_DATA
@@ -283,6 +284,7 @@ COMMENT ON COLUMN AT_PHYSICAL_LOCATION.PUBLISHED_LONGITUDE IS 'Longitude of loca
283
284
COMMENT ON COLUMN AT_PHYSICAL_LOCATION.OFFICE_CODE IS 'References the office who''s bounday contains this location.';
284
285
COMMENT ON COLUMN AT_PHYSICAL_LOCATION.NATION_CODE IS 'References the nation containing this location.';
285
286
COMMENT ON COLUMN AT_PHYSICAL_LOCATION.NEAREST_CITY IS 'Name of city nearest this location.';
287
+
COMMENT ON COLUMN AT_PHYSICAL_LOCATION.SEARCH_DOC IS 'Placeholder column for Oracle Text full-text search index. The indexed document text is dynamically generated by the USER_DATASTORE procedure (CWMS_LOC.BUILD_SEARCH_DOC) during indexing and is not stored in this column.';
286
288
287
289
288
290
ALTER TABLE AT_PHYSICAL_LOCATION ADD CONSTRAINT AT_PHYSICAL_LOCATION_CK1 CHECK (TRIM(SUB_LOCATION_ID) = SUB_LOCATION_ID);
Copy file name to clipboardExpand all lines: schema/src/cwms/views/av_loc.sql
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,7 @@ insert into at_clob
56
56
* @field nation_id Nation encompassing location (may be inherited from base location)
57
57
* @field nearest_city City nearest to location (may be inherited from base location)
58
58
* @field active_flag Depricated - loc_active_flag replaces active_flag as of v2.1
59
+
* @field search_doc Placeholder column for Oracle Text full-text search index. The indexed document text is dynamically generated by the USER_DATASTORE procedure (CWMS_LOC.BUILD_SEARCH_DOC) during indexing and is not stored in this column.
59
60
*/
60
61
');
61
62
@@ -90,7 +91,8 @@ select LOCATION_CODE,
90
91
BOUNDING_OFFICE_ID,
91
92
NATION_ID,
92
93
NEAREST_CITY,
93
-
active_flag
94
+
active_flag,
95
+
SEARCH_DOC
94
96
from
95
97
( with phy_loc as
96
98
( select loc.location_code,
@@ -119,7 +121,8 @@ from
119
121
nvl (loc.nearest_city, bas.nearest_city) as nearest_city,
120
122
blo.active_flag as base_loc_active_flag,
121
123
loc.active_flag as loc_active_flag,
122
-
loc.active_flag as active_flag
124
+
loc.active_flag as active_flag,
125
+
loc.search_doc
123
126
from -- join the base location metadata (bas) with the location (loc)
124
127
cwms_20.at_physical_location loc left join
125
128
cwms_20.at_physical_location bas on ( bas.location_code = loc.base_location_code ) left join
Copy file name to clipboardExpand all lines: schema/src/cwms/views/av_loc2.sql
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,7 @@ insert into at_clob
64
64
* @field loc_alias_category The location category that owns the location group to which the alias for the location_id or base_location_id belongs. Null if location_id is not an alias.
65
65
* @field loc_alias_group The location group to which the alias for the location_id or base_location_id belongs. Null if location_id is not an alias.
66
66
* @field db_office_code Unique number identifying the office that owns the location
67
+
* @field search_doc Placeholder column for Oracle Text full-text search index. The indexed document text is dynamically generated by the USER_DATASTORE procedure (CWMS_LOC.BUILD_SEARCH_DOC) during indexing and is not stored in this column.
67
68
*/
68
69
');
69
70
@@ -102,7 +103,8 @@ create or replace force view av_loc2
0 commit comments