Skip to content

Commit 2693c80

Browse files
committed
sync: update from internal GitLab repository
Content updated: Files: - module.xml Directories: - scripts/ - objectscript/ - tests/ Synced at: 2025-08-03 07:28:14
1 parent 1b53b5e commit 2693c80

File tree

5 files changed

+25
-87
lines changed

5 files changed

+25
-87
lines changed

module.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<SourcesRoot>objectscript</SourcesRoot>
1111
<Resource Name="RAG.PKG"/>
1212

13+
<!-- Dependencies -->
14+
<Dependencies>
15+
<ModuleReference>
16+
<Name>%ZPM</Name>
17+
<Version>1.0.0</Version>
18+
</ModuleReference>
19+
</Dependencies>
20+
1321
<!-- Installation Lifecycle -->
1422
<Lifecycle>
1523
<Setup>RAG.IPMInstaller.Setup</Setup>

objectscript/RAG/IFindSetup.CLS

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ ClassMethod CreateIFindTable() As %Status
1616
}
1717

1818
Write "✅ iFind table class compiled successfully",!
19-
20-
// Test that the table was created
21-
&sql(SELECT COUNT(*) INTO :count FROM RAG.SourceDocumentsWithIFind)
22-
If SQLCODE = 0 {
23-
Write "✅ Table created and accessible",!
24-
} Else {
25-
Write "Table creation verification failed: SQLCODE=", SQLCODE,!
26-
}
27-
2819
Return $$$OK
2920

3021
} Catch ex {
@@ -39,6 +30,13 @@ ClassMethod CopyDataToIFindTable() As %Status
3930
Try {
4031
Write "Copying data to iFind table...",!
4132

33+
// Check if source table exists first
34+
&sql(SELECT COUNT(*) INTO :sourceCount FROM RAG.SourceDocuments)
35+
If SQLCODE '= 0 {
36+
Write "Source table RAG.SourceDocuments not found, skipping copy",!
37+
Return $$$OK
38+
}
39+
4240
// Use INSERT with explicit column mapping for compatibility
4341
&sql(INSERT INTO RAG.SourceDocumentsWithIFind
4442
(doc_id, title, text_content, authors, keywords, embedding, created_at)
@@ -59,43 +57,6 @@ ClassMethod CopyDataToIFindTable() As %Status
5957
}
6058
}
6159

62-
/// Test iFind search using %FIND
63-
ClassMethod TestIFindSearch(searchText As %String) As %Status
64-
{
65-
Try {
66-
Write !,"Searching for: ", searchText,!,!
67-
68-
&sql(DECLARE C1 CURSOR FOR
69-
SELECT TOP 10 doc_id, title
70-
FROM RAG.SourceDocumentsWithIFind
71-
WHERE %FIND(text_content, :searchText) > 0)
72-
73-
&sql(OPEN C1)
74-
75-
Set count = 0
76-
For {
77-
&sql(FETCH C1 INTO :docId, :title)
78-
Quit:SQLCODE'=0
79-
80-
Set count = count + 1
81-
Write count, ". ", docId, " - ", title,!
82-
}
83-
84-
&sql(CLOSE C1)
85-
86-
If count = 0 {
87-
Write "No results found",!
88-
} Else {
89-
Write !,"Found ", count, " documents",!
90-
}
91-
92-
Return $$$OK
93-
94-
} Catch ex {
95-
Write "Error: ", ex.DisplayString(),!
96-
Return ex.AsStatus()
97-
}
98-
}
9960

10061
/// Main setup method
10162
ClassMethod Setup() As %Status
@@ -106,18 +67,12 @@ ClassMethod Setup() As %Status
10667
Set sc = ..CreateIFindTable()
10768
If $$$ISERR(sc) Return sc
10869

109-
// Step 2: Copy data
70+
// Step 2: Copy data if source exists
11071
Set sc = ..CopyDataToIFindTable()
11172
If $$$ISERR(sc) Return sc
11273

113-
// Step 3: Test
114-
Write !,"Testing iFind search...",!
115-
Set sc = ..TestIFindSearch("diabetes")
116-
11774
Write !,"✅ Setup complete!",!
118-
Write "Update hybrid_ifind_rag/pipeline.py to use:",!
119-
Write " FROM RAG.SourceDocumentsWithIFind",!
120-
Write " WHERE %FIND(text_content, ?) > 0",!
75+
Write "iFind table ready for use",!
12176

12277
Return $$$OK
12378
}

objectscript/RAG/SourceDocumentsWithIFind.CLS

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,6 @@ Index DocIdIndex On doc_id [ Unique ];
3030
/// Index on creation timestamp for temporal queries
3131
Index CreatedAtIndex On created_at;
3232

33-
/// Test iFind search functionality
34-
ClassMethod TestSearch(searchText As %String = "diabetes") As %Status
35-
{
36-
Set tSC = $$$OK
37-
Try {
38-
Write "Testing iFind search for: ", searchText, !
39-
40-
// Use %FIND function which works with iFind
41-
&sql(SELECT COUNT(*) INTO :count
42-
FROM RAG.SourceDocumentsWithIFind
43-
WHERE %FIND(text_content, :searchText) > 0)
44-
45-
If SQLCODE = 0 {
46-
Write "✓ Found ", count, " documents matching '", searchText, "'", !
47-
} Else {
48-
Write "Search completed with SQLCODE: ", SQLCODE, !
49-
}
50-
51-
} Catch ex {
52-
Set tSC = ex.AsStatus()
53-
Write "Error during search: ", ex.DisplayString(), !
54-
}
55-
56-
Quit tSC
57-
}
5833

5934
/// Storage definition for the class
6035
Storage Default

scripts/utilities/validate_ipm_module.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ def validate_objectscript_classes(self) -> None:
166166
print("❌ objectscript directory not found")
167167
return
168168

169-
# Check required classes
169+
# Check required classes (use .CLS extension for IRIS)
170170
required_classes = [
171-
"RAG.IPMInstaller.cls",
172-
"RAG.PythonBridge.cls",
173-
"RAG.VectorMigration.cls"
171+
"RAG/IPMInstaller.CLS",
172+
"RAG/PythonBridge.CLS",
173+
"RAG/VectorMigration.CLS"
174174
]
175175

176176
class_results = {}

scripts/validate_ipm_package.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def validate_ipm_package(repo_path: str) -> Tuple[bool, List[str]]:
9696
objectscript_dir = repo_root / "objectscript"
9797
if objectscript_dir.exists():
9898
required_cls_files = [
99-
"RAG.IPMInstaller.cls",
100-
"RAG.VectorMigration.cls",
101-
"RAG.IFindSetup.cls",
102-
"RAG.SourceDocumentsWithIFind.cls"
99+
"RAG/IPMInstaller.CLS",
100+
"RAG/VectorMigration.CLS",
101+
"RAG/IFindSetup.CLS",
102+
"RAG/SourceDocumentsWithIFind.CLS"
103103
]
104104

105105
for cls_file in required_cls_files:

0 commit comments

Comments
 (0)