Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit 51ddb48

Browse files
committed
MINOR: add document full text search (#893)
* add document full text search * use cloud language if no language provided * enable text only on ai clouds * fix tests * add comment to doc * fix test with new field
1 parent fc4e842 commit 51ddb48

15 files changed

+752
-96
lines changed

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ docs/Direction.md
3939
docs/DirectionRequest.md
4040
docs/Document.md
4141
docs/DocumentPreviewFile.md
42+
docs/DocumentText.md
4243
docs/DocumentWithElementList.md
4344
docs/Drawing.md
4445
docs/DrawingRequest.md
@@ -111,6 +112,7 @@ docs/PatchedClassificationRequest.md
111112
docs/PatchedCloudRequest.md
112113
docs/PatchedCommentRequest.md
113114
docs/PatchedDocumentRequest.md
115+
docs/PatchedDocumentTextRequest.md
114116
docs/PatchedDrawingRequest.md
115117
docs/PatchedElementRequest.md
116118
docs/PatchedFolderWithoutChildrenRequest.md
@@ -317,6 +319,7 @@ src/model/Direction.js
317319
src/model/DirectionRequest.js
318320
src/model/Document.js
319321
src/model/DocumentPreviewFile.js
322+
src/model/DocumentText.js
320323
src/model/DocumentWithElementList.js
321324
src/model/Drawing.js
322325
src/model/DrawingRequest.js
@@ -388,6 +391,7 @@ src/model/PatchedClassificationRequest.js
388391
src/model/PatchedCloudRequest.js
389392
src/model/PatchedCommentRequest.js
390393
src/model/PatchedDocumentRequest.js
394+
src/model/PatchedDocumentTextRequest.js
391395
src/model/PatchedDrawingRequest.js
392396
src/model/PatchedElementRequest.js
393397
src/model/PatchedFolderWithoutChildrenRequest.js
@@ -588,6 +592,7 @@ test/model/Direction.spec.js
588592
test/model/DirectionRequest.spec.js
589593
test/model/Document.spec.js
590594
test/model/DocumentPreviewFile.spec.js
595+
test/model/DocumentText.spec.js
591596
test/model/DocumentWithElementList.spec.js
592597
test/model/Drawing.spec.js
593598
test/model/DrawingRequest.spec.js
@@ -659,6 +664,7 @@ test/model/PatchedClassificationRequest.spec.js
659664
test/model/PatchedCloudRequest.spec.js
660665
test/model/PatchedCommentRequest.spec.js
661666
test/model/PatchedDocumentRequest.spec.js
667+
test/model/PatchedDocumentTextRequest.spec.js
662668
test/model/PatchedDrawingRequest.spec.js
663669
test/model/PatchedElementRequest.spec.js
664670
test/model/PatchedFolderWithoutChildrenRequest.spec.js

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ Class | Method | HTTP request | Description
302302
*bimdata.CollaborationApi* | [**updateCloud**](docs/CollaborationApi.md#updateCloud) | **PATCH** /cloud/{id} | Update some fields of a cloud
303303
*bimdata.CollaborationApi* | [**updateCloudUser**](docs/CollaborationApi.md#updateCloudUser) | **PATCH** /cloud/{cloud_pk}/user/{id} | Change the user role in the cloud
304304
*bimdata.CollaborationApi* | [**updateDocument**](docs/CollaborationApi.md#updateDocument) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id} | Update some fields of the document
305+
*bimdata.CollaborationApi* | [**updateDocumentText**](docs/CollaborationApi.md#updateDocumentText) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id}/text | Update the text representation of a document
305306
*bimdata.CollaborationApi* | [**updateFolder**](docs/CollaborationApi.md#updateFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{id} | Update some fields of a folder
306307
*bimdata.CollaborationApi* | [**updateGroupFolder**](docs/CollaborationApi.md#updateGroupFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{folder_pk}/group/{id} | Update the permission of a group on a folder. When propagate is set to True, the permission of all children in the folder will be updated.
307308
*bimdata.CollaborationApi* | [**updateManageGroup**](docs/CollaborationApi.md#updateManageGroup) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/group/{id} | Update some fields of a group
@@ -535,6 +536,7 @@ Class | Method | HTTP request | Description
535536
- [bimdata.DirectionRequest](docs/DirectionRequest.md)
536537
- [bimdata.Document](docs/Document.md)
537538
- [bimdata.DocumentPreviewFile](docs/DocumentPreviewFile.md)
539+
- [bimdata.DocumentText](docs/DocumentText.md)
538540
- [bimdata.DocumentWithElementList](docs/DocumentWithElementList.md)
539541
- [bimdata.Drawing](docs/Drawing.md)
540542
- [bimdata.DrawingRequest](docs/DrawingRequest.md)
@@ -606,6 +608,7 @@ Class | Method | HTTP request | Description
606608
- [bimdata.PatchedCloudRequest](docs/PatchedCloudRequest.md)
607609
- [bimdata.PatchedCommentRequest](docs/PatchedCommentRequest.md)
608610
- [bimdata.PatchedDocumentRequest](docs/PatchedDocumentRequest.md)
611+
- [bimdata.PatchedDocumentTextRequest](docs/PatchedDocumentTextRequest.md)
609612
- [bimdata.PatchedDrawingRequest](docs/PatchedDrawingRequest.md)
610613
- [bimdata.PatchedElementRequest](docs/PatchedElementRequest.md)
611614
- [bimdata.PatchedFolderWithoutChildrenRequest](docs/PatchedFolderWithoutChildrenRequest.md)

docs/CollaborationApi.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Method | HTTP request | Description
102102
[**updateCloud**](CollaborationApi.md#updateCloud) | **PATCH** /cloud/{id} | Update some fields of a cloud
103103
[**updateCloudUser**](CollaborationApi.md#updateCloudUser) | **PATCH** /cloud/{cloud_pk}/user/{id} | Change the user role in the cloud
104104
[**updateDocument**](CollaborationApi.md#updateDocument) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id} | Update some fields of the document
105+
[**updateDocumentText**](CollaborationApi.md#updateDocumentText) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id}/text | Update the text representation of a document
105106
[**updateFolder**](CollaborationApi.md#updateFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{id} | Update some fields of a folder
106107
[**updateGroupFolder**](CollaborationApi.md#updateGroupFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{folder_pk}/group/{id} | Update the permission of a group on a folder. When propagate is set to True, the permission of all children in the folder will be updated.
107108
[**updateManageGroup**](CollaborationApi.md#updateManageGroup) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/group/{id} | Update some fields of a group
@@ -960,7 +961,7 @@ Name | Type | Description | Notes
960961
961962
Create a document
962963

963-
Create a document. If the document is one of {'GLTF', 'IFC', 'OBJ', 'POINT_CLOUD', 'DXF', 'DWG'}, a model will be created and attached to this document Required scopes: document:write
964+
Create a document. If the document is one of {'IFC', 'POINT_CLOUD', 'DWG', 'DXF', 'GLTF', 'OBJ'}, a model will be created and attached to this document Required scopes: document:write
964965

965966
### Example
966967

@@ -3387,7 +3388,7 @@ Name | Type | Description | Notes
33873388
33883389
Retrieve all documents
33893390

3390-
Retrieve all documents in the project. Filters are case insentive Required scopes: document:read
3391+
Retrieve all documents in the project. Filters are case insentive. Search filter only works if AI features are enabled. Required scopes: document:read
33913392

33923393
### Example
33933394

@@ -3431,9 +3432,11 @@ let opts = {
34313432
'nameContains': "nameContains_example", // String |
34323433
'nameEndswith': "nameEndswith_example", // String |
34333434
'nameStartswith': "nameStartswith_example", // String |
3435+
'search': "search_example", // String |
34343436
'sizeMax': 789, // Number | Size of the file.
34353437
'sizeMin': 789, // Number | Size of the file.
34363438
'tags': ["null"], // [String] | Multiple values may be separated by commas.
3439+
'text': true, // Boolean | If this field is present (with any value), the full text representation of the documents will be added to the response under the field `text`
34373440
'visaCreatorEmail': "visaCreatorEmail_example", // String |
34383441
'visaDeadlineAfter': new Date("2013-10-20"), // Date |
34393442
'visaDeadlineBefore': new Date("2013-10-20"), // Date |
@@ -3475,9 +3478,11 @@ Name | Type | Description | Notes
34753478
**nameContains** | **String**| | [optional]
34763479
**nameEndswith** | **String**| | [optional]
34773480
**nameStartswith** | **String**| | [optional]
3481+
**search** | **String**| | [optional]
34783482
**sizeMax** | **Number**| Size of the file. | [optional]
34793483
**sizeMin** | **Number**| Size of the file. | [optional]
34803484
**tags** | [**[String]**](String.md)| Multiple values may be separated by commas. | [optional]
3485+
**text** | **Boolean**| If this field is present (with any value), the full text representation of the documents will be added to the response under the field `text` | [optional]
34813486
**visaCreatorEmail** | **String**| | [optional]
34823487
**visaDeadlineAfter** | **Date**| | [optional]
34833488
**visaDeadlineBefore** | **Date**| | [optional]
@@ -3618,6 +3623,7 @@ let opts = {
36183623
'nameContains': "nameContains_example", // String |
36193624
'nameEndswith': "nameEndswith_example", // String |
36203625
'nameStartswith': "nameStartswith_example", // String |
3626+
'search': "search_example", // String |
36213627
'sizeMax': 789, // Number | Size of the file.
36223628
'sizeMin': 789, // Number | Size of the file.
36233629
'tags': ["null"], // [String] | Multiple values may be separated by commas.
@@ -3663,6 +3669,7 @@ Name | Type | Description | Notes
36633669
**nameContains** | **String**| | [optional]
36643670
**nameEndswith** | **String**| | [optional]
36653671
**nameStartswith** | **String**| | [optional]
3672+
**search** | **String**| | [optional]
36663673
**sizeMax** | **Number**| Size of the file. | [optional]
36673674
**sizeMin** | **Number**| Size of the file. | [optional]
36683675
**tags** | [**[String]**](String.md)| Multiple values may be separated by commas. | [optional]
@@ -6619,6 +6626,75 @@ Name | Type | Description | Notes
66196626
- **Accept**: application/json
66206627

66216628

6629+
## updateDocumentText
6630+
6631+
> DocumentText updateDocumentText(cloudPk, id, projectPk, opts)
6632+
6633+
Update the text representation of a document
6634+
6635+
Update the text representation of a document. The document itself will not be changed. It is useful for full text search Required scopes: document:write
6636+
6637+
### Example
6638+
6639+
```javascript
6640+
import bimdata from '@bimdata/bimdata-api-client';
6641+
let defaultClient = bimdata.ApiClient.instance;
6642+
// Configure API key authorization: ApiKey
6643+
let ApiKey = defaultClient.authentications['ApiKey'];
6644+
ApiKey.apiKey = 'YOUR API KEY';
6645+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
6646+
//ApiKey.apiKeyPrefix = 'Token';
6647+
// Configure OAuth2 access token for authorization: BIMData_Connect
6648+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
6649+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
6650+
// Configure OAuth2 access token for authorization: BIMData_Connect
6651+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
6652+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
6653+
// Configure API key authorization: Bearer
6654+
let Bearer = defaultClient.authentications['Bearer'];
6655+
Bearer.apiKey = 'YOUR API KEY';
6656+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
6657+
//Bearer.apiKeyPrefix = 'Token';
6658+
6659+
let apiInstance = new bimdata.CollaborationApi();
6660+
let cloudPk = 56; // Number | A unique integer value identifying this cloud.
6661+
let id = 56; // Number | A unique integer value identifying this document.
6662+
let projectPk = 56; // Number | A unique integer value identifying this project.
6663+
let opts = {
6664+
'patchedDocumentTextRequest': new bimdata.PatchedDocumentTextRequest() // PatchedDocumentTextRequest |
6665+
};
6666+
apiInstance.updateDocumentText(cloudPk, id, projectPk, opts).then((data) => {
6667+
console.log('API called successfully. Returned data: ' + data);
6668+
}, (error) => {
6669+
console.error(error);
6670+
});
6671+
6672+
```
6673+
6674+
### Parameters
6675+
6676+
6677+
Name | Type | Description | Notes
6678+
------------- | ------------- | ------------- | -------------
6679+
**cloudPk** | **Number**| A unique integer value identifying this cloud. |
6680+
**id** | **Number**| A unique integer value identifying this document. |
6681+
**projectPk** | **Number**| A unique integer value identifying this project. |
6682+
**patchedDocumentTextRequest** | [**PatchedDocumentTextRequest**](PatchedDocumentTextRequest.md)| | [optional]
6683+
6684+
### Return type
6685+
6686+
[**DocumentText**](DocumentText.md)
6687+
6688+
### Authorization
6689+
6690+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
6691+
6692+
### HTTP request headers
6693+
6694+
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
6695+
- **Accept**: application/json
6696+
6697+
66226698
## updateFolder
66236699

66246700
> FolderWithoutChildren updateFolder(cloudPk, id, projectPk, opts)

docs/DocumentText.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# bimdata.DocumentText
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **Number** | | [readonly]
8+
**text** | **String** | The full text representation of a document if the feature is enabled and the file format supported | [optional]
9+
**language** | **String** | * `french` - french * `spanish` - spanish * `german` - german * `english` - english * `italian` - italian | [optional]
10+
11+
12+
13+
## Enum: LanguageEnum
14+
15+
16+
* `french` (value: `"french"`)
17+
18+
* `spanish` (value: `"spanish"`)
19+
20+
* `german` (value: `"german"`)
21+
22+
* `english` (value: `"english"`)
23+
24+
* `italian` (value: `"italian"`)
25+
26+
* `null` (value: `"null"`)
27+
28+
29+
30+

docs/PatchedDocumentTextRequest.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# bimdata.PatchedDocumentTextRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**text** | **String** | The full text representation of a document if the feature is enabled and the file format supported | [optional]
8+
**language** | **String** | * `french` - french * `spanish` - spanish * `german` - german * `english` - english * `italian` - italian | [optional]
9+
10+
11+
12+
## Enum: LanguageEnum
13+
14+
15+
* `french` (value: `"french"`)
16+
17+
* `spanish` (value: `"spanish"`)
18+
19+
* `german` (value: `"german"`)
20+
21+
* `english` (value: `"english"`)
22+
23+
* `italian` (value: `"italian"`)
24+
25+
* `null` (value: `"null"`)
26+
27+
28+
29+

docs/WriteFolder.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**type** | **String** | DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
78
**parentId** | **Number** | | [optional]
9+
**createdAt** | **Date** | Creation date | [readonly]
10+
**createdBy** | [**ShortUser**](ShortUser.md) | | [readonly]
11+
**id** | **Number** | | [readonly]
12+
**name** | **String** | Name of the folder |
813
**updatedAt** | **Date** | Date of the last update | [readonly]
14+
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
915
**groupsPermissions** | [**[GroupFolderRead]**](GroupFolderRead.md) | List of group permissions | [readonly]
10-
**name** | **String** | Name of the folder |
11-
**id** | **Number** | | [readonly]
12-
**createdBy** | [**ShortUser**](ShortUser.md) | | [readonly]
1316
**userPermission** | **Number** | Aggregate of group user permissions and folder default permission | [readonly]
1417
**nature** | **String** | Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
15-
**createdAt** | **Date** | Creation date | [readonly]
16-
**type** | **String** | DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
17-
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
1818
**children** | [**[WriteFolder]**](WriteFolder.md) | | [optional]
1919

2020

2121

22-
## Enum: UserPermissionEnum
22+
## Enum: DefaultPermissionEnum
2323

2424

2525
* `1` (value: `1`)
@@ -32,7 +32,7 @@ Name | Type | Description | Notes
3232

3333

3434

35-
## Enum: DefaultPermissionEnum
35+
## Enum: UserPermissionEnum
3636

3737

3838
* `1` (value: `1`)

0 commit comments

Comments
 (0)