Skip to content

Commit 0c1a572

Browse files
authored
Merge pull request #583 from unoplat/schema-index-updates
feat: schema index changes
2 parents 110e42e + eb092e4 commit 0c1a572

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

unoplat-code-confluence-commons/schema_documentation.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class CodeConfluenceGitRepository(BaseNode):
126126
- `git_repository` (AsyncRelationshipTo → CodeConfluenceGitRepository, 'PART_OF_GIT_REPOSITORY', cardinality=AsyncOne): Connects to the parent git repository.
127127

128128
**Code**:
129+
129130
```python
130131
from neomodel import (
131132
StringProperty,
@@ -208,6 +209,7 @@ class CodeConfluenceCodebase(BaseNode):
208209
- `codebase` (AsyncRelationshipFrom ← CodeConfluenceCodebase, 'HAS_PACKAGE_MANAGER_METADATA', cardinality=AsyncOne): Connection back to the parent codebase.
209210

210211
**Code**:
212+
211213
```python
212214
from neomodel import (
213215
StringProperty,
@@ -271,6 +273,7 @@ class CodeConfluencePackageManagerMetadata(BaseNode):
271273
- `files` (AsyncRelationshipTo → CodeConfluenceFile, 'CONTAINS_FILE', cardinality=AsyncZeroOrMore): Connects to files within the package.
272274

273275
**Code**:
276+
274277
```python
275278
from neomodel import (
276279
StringProperty,
@@ -326,22 +329,23 @@ class CodeConfluencePackage(BaseNode):
326329
**Properties**:
327330

328331
- `file_path` (StringProperty, required=True, unique_index=True): Path to the file.
329-
- `content` (StringProperty): Content of the file.
332+
- `content` (StringProperty, fulltext_index=FulltextIndex(analyzer="english")): Content of the file with full-text search support.
330333
- `checksum` (StringProperty): Checksum of the file content.
331334
- `structural_signature` (JSONProperty): Structural signature of the file.
332335
- `global_variables` (ArrayProperty(StringProperty), default=[]): List of global variables in the file.
333336
- `class_variables` (JSONProperty): Class variables information.
334-
- `imports` (ArrayProperty(StringProperty), default=[]): List of imports in the file.
337+
- `imports` (ArrayProperty(StringProperty), default=[], fulltext_index=FulltextIndex(analyzer="english")): List of imports in the file with full-text search support.
338+
- `poi_labels` (ArrayProperty(StringProperty), fulltext_index=FulltextIndex(analyzer="english")): Points of interest labels with full-text search support.
335339

336340
**Relationships**:
337341

338342
- `package` (AsyncRelationshipTo → CodeConfluencePackage, 'PART_OF_PACKAGE', cardinality=AsyncOne): Connection to the parent package.
339343

340344
**Code**:
341-
```python
342-
from neomodel import AsyncStructuredNode, StringProperty, AsyncRelationshipTo, AsyncRelationship, AsyncOne, AsyncZeroOrMore
343-
from neomodel import JSONProperty, ArrayProperty
344345

346+
```python
347+
from neomodel import AsyncStructuredNode, StringProperty, AsyncRelationshipTo, AsyncOne
348+
from neomodel import JSONProperty, ArrayProperty, FulltextIndex
345349
from unoplat_code_confluence_commons.graph_models.base_models import ContainsRelationship
346350

347351
class CodeConfluenceFile(AsyncStructuredNode):
@@ -353,13 +357,20 @@ class CodeConfluenceFile(AsyncStructuredNode):
353357
package (PART_OF_PACKAGE) -> CodeConfluencePackage
354358
"""
355359
file_path = StringProperty(required=True, unique_index=True)
356-
content = StringProperty()
360+
content = StringProperty(fulltext_index=FulltextIndex(analyzer="english"))
357361
checksum = StringProperty()
358362
structural_signature = JSONProperty()
359363
global_variables = ArrayProperty(StringProperty(), default=[])
360364
class_variables = JSONProperty()
361-
imports = ArrayProperty(StringProperty(), default=[])
362-
365+
imports = ArrayProperty(
366+
StringProperty(),
367+
default=[],
368+
fulltext_index=FulltextIndex(analyzer="english")
369+
)
370+
poi_labels = ArrayProperty(
371+
StringProperty(),
372+
fulltext_index=FulltextIndex(analyzer="english")
373+
)
363374
package = AsyncRelationshipTo(
364375
'.code_confluence_package.CodeConfluencePackage',
365376
'PART_OF_PACKAGE',
@@ -384,4 +395,4 @@ CodeConfluenceGitRepository
384395
└── PART_OF_PACKAGE → CodeConfluencePackage
385396
```
386397

387-
This schema represents a comprehensive graph model for code analysis and representation, capturing the relationships between repositories, codebases, packages, and files.
398+
This schema represents a comprehensive graph model for code analysis and representation, capturing the relationships between repositories, codebases, packages, and files.

unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/code_confluence_file.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from neomodel import AsyncStructuredNode, StringProperty, AsyncRelationshipTo, AsyncOne
33

44
from unoplat_code_confluence_commons.graph_models.base_models import ContainsRelationship
5-
from neomodel import JSONProperty, ArrayProperty
5+
from neomodel import JSONProperty, ArrayProperty, FulltextIndex
66

77
# ⬇️ insert just above class `CodeConfluencePackage`
88
class CodeConfluenceFile(AsyncStructuredNode):
@@ -14,13 +14,20 @@ class CodeConfluenceFile(AsyncStructuredNode):
1414
package (PART_OF_PACKAGE) -> CodeConfluencePackage
1515
"""
1616
file_path = StringProperty(required=True, unique_index=True)
17-
content = StringProperty()
17+
content = StringProperty(fulltext_index=FulltextIndex(analyzer="english"))
1818
checksum = StringProperty()
1919
structural_signature = JSONProperty()
2020
global_variables = ArrayProperty(StringProperty(), default=[])
2121
class_variables = JSONProperty()
22-
imports = ArrayProperty(StringProperty(), default=[])
23-
22+
imports = ArrayProperty(
23+
StringProperty(),
24+
default=[],
25+
fulltext_index=FulltextIndex(analyzer="english")
26+
)
27+
poi_labels = ArrayProperty(
28+
StringProperty(),
29+
fulltext_index=FulltextIndex(analyzer="english")
30+
)
2431
package = AsyncRelationshipTo(
2532
'.code_confluence_package.CodeConfluencePackage',
2633
'PART_OF_PACKAGE',

0 commit comments

Comments
 (0)