Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development to main #177

Merged
merged 43 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
607e1fa
fixed files list
SudoThijn Jan 30, 2025
6710209
used wrong date property
SudoThijn Jan 30, 2025
7b040c5
bug fixes
SudoThijn Jan 30, 2025
cf774e4
Merge pull request #152 from ConductionNL/feature/REGISTERS-98/files-fix
SudoThijn Jan 30, 2025
651f3b0
Add metadata to objects
rubenvdlinde Jan 31, 2025
a10b921
Fetch tags for files
bbrands02 Feb 7, 2025
2956661
A small fix for naming Register NC folders (in which we save documents)
WilcoLouwerse Feb 7, 2025
79a0a60
Merge pull request #169 from ConductionNL/feature/CONNECTOR-209/searc…
WilcoLouwerse Feb 10, 2025
c4a3cf9
Small improvement fetch file tag
bbrands02 Feb 10, 2025
3585901
Merge remote-tracking branch 'origin/development' into feature/CONNEC…
bbrands02 Feb 10, 2025
751620a
Added some basic documentation for the fulltextsearch app(s)
WilcoLouwerse Feb 10, 2025
1e2594e
Added a more information header at the end of fulltextsearch docu.md
WilcoLouwerse Feb 10, 2025
63b25b3
Do some fixes in FileService
WilcoLouwerse Feb 11, 2025
a9768af
small style fix
WilcoLouwerse Feb 11, 2025
cb766b8
Aanpassing op verzoek van @robert
rubenvdlinde Feb 11, 2025
9f8857a
Merge pull request #171 from ConductionNL/feature/CONNECTOR-209/full-…
WilcoLouwerse Feb 11, 2025
d7b1893
Merge pull request #174 from ConductionNL/fix/file-service
WilcoLouwerse Feb 11, 2025
8264de7
Let's make sure OpenConnector & OpenCatalogi can still use this function
WilcoLouwerse Feb 11, 2025
1a76f00
Merge pull request #175 from ConductionNL/fix/file-service
WilcoLouwerse Feb 11, 2025
470740d
Remove empty file
rubenvdlinde Feb 11, 2025
e6f9dc6
Merge pull request #153 from ConductionNL/feature/REGISTERS-99/metadata
rubenvdlinde Feb 11, 2025
59a2742
Fix return of tags
bbrands02 Feb 11, 2025
25203b6
IBOC-148 > Fix for setting folder property correctly
WilcoLouwerse Feb 11, 2025
a0803fb
name tags labels when returning
bbrands02 Feb 11, 2025
36a8d31
Merge remote-tracking branch 'origin/development' into feature/CONNEC…
bbrands02 Feb 11, 2025
d398c1d
Move getting tags to fileService
bbrands02 Feb 11, 2025
d260597
revert changes
bbrands02 Feb 11, 2025
71d7566
Merge pull request #176 from ConductionNL/fix/CONNECTOR-239/folder-pr…
WilcoLouwerse Feb 11, 2025
cfecf03
Merge remote-tracking branch 'origin/development' into feature/CONNEC…
bbrands02 Feb 11, 2025
90bbeba
Fix for creating publications
WilcoLouwerse Feb 11, 2025
7a4a2bc
Merge pull request #170 from ConductionNL/feature/CONNECTOR-219/fetch…
bbrands02 Feb 11, 2025
0c33db0
Merge pull request #178 from ConductionNL/fix/file-service-bug
WilcoLouwerse Feb 11, 2025
e4e5f6a
Update the file service to always work on the OpenCatalogi user
rubenvdlinde Feb 12, 2025
ed39fa2
Add an add file function to the object and file service
rubenvdlinde Feb 12, 2025
e3d9684
Merge remote-tracking branch 'origin/development' into feature/REGIST…
rubenvdlinde Feb 12, 2025
20fa7fe
Merge pull request #179 from ConductionNL/feature/REGISTERS-104/file-…
rubenvdlinde Feb 12, 2025
de66a1d
Fixing the try catch
rubenvdlinde Feb 12, 2025
aa2be5f
Merge pull request #182 from ConductionNL/hotfix/try-catch-error
rubenvdlinde Feb 12, 2025
e9ef5a0
Force user session on OpenCatalogi for file creation
rubenvdlinde Feb 12, 2025
216cf0a
Remove set owner
rubenvdlinde Feb 12, 2025
7c83f86
Merge pull request #183 from ConductionNL/hotfix/try-catch-error
rubenvdlinde Feb 12, 2025
f633650
Wrong user
rubenvdlinde Feb 12, 2025
9728683
Merge pull request #184 from ConductionNL/hotfix/try-catch-error
rubenvdlinde Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions docs/fulltextsearch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Full Text Search NextCloud App(s)

## Overview

This document provides some information about the NextCloud Full Text Search App(s) and a step-by-step plan how to set this up on your local machine with the use of ElasticSearch as search platform.

## Local Setup Steps

1. Open a command-line interface (CLI), such as:
- **Windows:** Command Prompt (`cmd`), PowerShell, or Windows Terminal.
- **Linux/macOS:** Terminal.
2. Navigate to your local Nextcloud repository (where a docker-compose.yml file is present):
```sh
cd {route to your local NC repo}
```
3. Start the necessary Docker containers:
```sh
docker-compose up nextcloud proxy elasticsearch
```
4. In the Nextcloud front-end, go to **NC Apps > Search** and install the following three apps:
- **Full text search Files**
- **Full text search Elastic**
- **Full text search**
5. Under **Administrator settings**, go to **Full text search** in the sidebar.
6. Under **General**, configure the following:
- **Search Platform:** Set to **"Elasticsearch"**.
- **Navigation Icon:** Check this option.
7. Under **Elastic Search**, set the following:
- **Address of the Servlet:**
```
http://elastic:elastic@elasticsearch:9200
```
- **Index:**
```
my_index
```
- **[Advanced] Analyzer tokenizer:**
```
standard
```
8. Under **Files**, configure the following
- **Check all checkboxes:**
- Local Files
- Group Folders
- Extract PDF
- Extract Office & Open Files
- **Maximum file size:** Set your prefered maximum file size (at least **64** is recommended).
9. Add some files to Nextcloud in the Files tab of NextCloud.
10. Run the indexing command in the `master-nextcloud-1` container in Docker Desktop:
```sh
sudo -u www-data php ./occ fulltextsearch:index
```
11. Open the **search app** and search for files based on the text inside them.

## More Information

If you need more details or troubleshooting help, you can refer to the following resources:

- [Nextcloud Full Text Search Wiki - Basic Installation](https://github.com/nextcloud/fulltextsearch/wiki/Basic-Installation)
- [Nextcloud Docker Development - Full Text Search](https://juliusknorr.github.io/nextcloud-docker-dev/services/more/#fulltextsearch)
- [YouTube Guide on Full Text Search for Nextcloud](https://www.youtube.com/watch?v=yPZkrzgue5c)

These resources provide in-depth explanations, configurations, and troubleshooting tips.
Binary file added docs/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 40 additions & 2 deletions lib/Db/ObjectEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
use OCP\AppFramework\Db\Entity;
use OCP\IUserSession;

/**
* Entity class representing an object in the OpenRegister system
*
* This class handles storage and manipulation of objects including their metadata,
* locking mechanisms, and serialization for API responses.
*/
class ObjectEntity extends Entity implements JsonSerializable
{
protected ?string $uuid = null;
Expand All @@ -25,6 +31,9 @@ class ObjectEntity extends Entity implements JsonSerializable
protected ?DateTime $created = null;
protected ?string $folder = null; // The folder path where this object is stored

/**
* Initialize the entity and define field types
*/
public function __construct() {
$this->addType(fieldName:'uuid', type: 'string');
$this->addType(fieldName:'uri', type: 'string');
Expand All @@ -43,6 +52,11 @@ public function __construct() {
$this->addType(fieldName:'folder', type: 'string');
}

/**
* Get array of field names that are JSON type
*
* @return array List of field names that are JSON type
*/
public function getJsonFields(): array
{
return array_keys(
Expand All @@ -52,6 +66,12 @@ public function getJsonFields(): array
);
}

/**
* Hydrate the entity from an array of data
*
* @param array $object Array of data to hydrate the entity with
* @return self Returns the hydrated entity
*/
public function hydrate(array $object): self
{
$jsonFields = $this->getJsonFields();
Expand All @@ -76,12 +96,30 @@ public function hydrate(array $object): self
return $this;
}


/**
* Serialize the entity to JSON format
*
* Creates a metadata array containing object properties except sensitive fields.
* Filters out 'object', 'textRepresentation' and 'authorization' fields and
* stores remaining properties under '@self' key for API responses.
*
* @return array Serialized object data
*/
public function jsonSerialize(): array
{
return $this->object;
$metadata = [
'@self' => array_filter($this->getObjectArray(), function($key) {
return in_array($key, ['object', 'textRepresentation', 'authorization']) === false;
}, ARRAY_FILTER_USE_KEY)
];
return array_merge($metadata, $this->object);
}

/**
* Get array representation of all object properties
*
* @return array Array containing all object properties
*/
public function getObjectArray(): array
{
return [
Expand Down
Loading