diff --git a/de/articles/file-server-search.rst b/de/articles/file-server-search.rst new file mode 100644 index 000000000..f1edae8a3 --- /dev/null +++ b/de/articles/file-server-search.rst @@ -0,0 +1,156 @@ +============================================= +Volltextsuche für Dateiserver mit Open Source +============================================= + +Einführung +========== + +Je mehr Dateiserver die einzelnen Abteilungen aufstellen, desto weniger weiß irgendjemand noch, wo ein bestimmtes Dokument liegt. Die Windows-Suche arbeitet immer nur in einem freigegebenen Ordner und reicht nicht über Servergrenzen hinweg, und die Volltextsuche eines NAS endet an dessen Gehäuse. + +Ein Ausweg ist ein eigener Volltextsuchserver vor den Dateiservern. Diese Seite sammelt, was vor dem Einsatz von Fess, einem quelloffenen Volltextsuchserver, an dieser Stelle zu prüfen ist. + +Für wen diese Seite gedacht ist +=============================== + +- Alle, die mit der Suche auf einem internen Dateiserver oder NAS zu kämpfen haben +- Alle, die Volltextsuche prüfen und wissen möchten, ob Open Source dafür ausreicht +- Alle, die Suche einführen wollen, ohne bestehende Zugriffsrechte anzutasten + +Fess steht unter der Apache License 2.0 und verursacht keine Lizenzkosten. + +Wo die Dateien liegen dürfen +============================ + +Der Datei-Crawler von Fess beherrscht die folgenden Protokolle. Eingerichtet werden sie in der Verwaltungsoberfläche unter [Crawler] > [Dateisystem] als Start-URL des Crawls. + +.. list-table:: Unterstützte Protokolle + :header-rows: 1 + :widths: 12 33 55 + + * - Protokoll + - URL-Form + - Typischer Einsatz + * - ``file`` + - ``file:///home/share/documents/`` + - Ein Verzeichnis auf dem Rechner, der Fess ausführt, einschließlich eines bereits eingehängten NAS + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Windows-Dateifreigaben, von SMB 2.0.2 bis SMB 3.1.1 + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - Ältere Geräte, die nur SMB1/CIFS sprechen + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - FTP-Server + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 und S3-kompatibler Objektspeicher + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +Welche Protokolle aktiv sind, steht in ``crawler.file.protocols``; der Standardwert ist ``file,smb,smb1,ftp,s3,gcs``. + +Für Windows-Dateifreigaben ist normalerweise ``smb`` die richtige Wahl. ``smb1`` bleibt für alte NAS-Geräte und Druckserver erhalten, die nichts anderes können; SMB1 ist in Windows aus Sicherheitsgründen standardmäßig deaktiviert und daher für eine neue Installation keine Option. + +Bestehende Zugriffsrechte bleiben erhalten +========================================== + +Die größte Sorge bei einer Suche über einen Dateiserver ist, dass Dokumente in den Treffern auftauchen, die jemand nicht sehen darf. Erscheinen die Ordner von Personal und Buchhaltung bei allen, ist das Suchsystem unbrauchbar, wie gut das Ranking auch sein mag. + +Fess löst das, indem es **die Zugriffsrechte des Dateiservers selbst in die Suche übernimmt**. + +Funktionsweise +-------------- + +1. Beim Crawlen liest Fess die ACL jeder Datei +2. Die erlaubten und die verweigerten Konten und Gruppen werden als Rollen des Dokuments gespeichert +3. Bei der Suche werden diese Rollen mit denen des angemeldeten Benutzers abgeglichen, und nur zulässige Dokumente kommen zurück + +Sowohl Erlauben als auch Verweigern wird behandelt, intern unterschieden durch die Präfixe ``(allow)`` und ``(deny)``. Das Auslesen der Rollen aus der ACL ist standardmäßig aktiv. + +.. list-table:: Einstellungen für die Übernahme der Rechte + :header-rows: 1 + :widths: 38 14 48 + + * - Einstellung + - Standard + - Wirkung + * - ``smb.role.from.file`` + - ``true`` + - Übernimmt Rollen aus der ACL von über SMB gecrawlten Dateien + * - ``file.role.from.file`` + - ``true`` + - Übernimmt Rollen aus den Rechten des lokalen Dateisystems + * - ``ftp.role.from.file`` + - ``true`` + - Übernimmt Rollen aus über FTP gecrawlten Dateien + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - Welche SID-Typen zu Rollen werden; steuert die Behandlung von Benutzern und Gruppen + +Die Voraussetzung, die zuerst zu klären ist +------------------------------------------- + +Damit das durchgängig funktioniert, **muss die suchende Person dieselben Rollen tragen**. Im Dokument steht "diese Gruppe darf mich lesen"; solange der suchende Benutzer Fess nicht mitteilen kann, in welchen Gruppen er ist, gibt es nichts abzugleichen. + +Damit ist **die Anbindung an Active Directory oder LDAP eine Voraussetzung** für eine rechtebewusste Suche: Fess meldet Benutzer an demselben Verzeichnis an, an dem sie auch der Dateiserver authentifiziert. + +Werden dagegen nur freigegebene Ordner indiziert, die im Unternehmen ohnehin alle lesen dürfen, ist die Anbindung nicht nötig. An dieser Unterscheidung entscheidet sich meist der Umfang einer ersten Einführung. + +Welche Dateiformate gelesen werden +================================== + +Fess gewinnt den Text mit Apache Tika aus dem Dateiinhalt, sodass nicht nur der Name, sondern der Inhalt durchsuchbar ist. Genau das findet ein Dokument, an dessen Titel sich niemand mehr erinnert. + +Die wichtigsten Formate sind: + +- MS Office (doc, xls, ppt, docx, xlsx, pptx und weitere) +- PDF +- Reiner Text, HTML, XML +- Rich Text (rtf) +- Quelltext (js, c, h, java und weitere) +- Archive (gz, tar, zip und weitere; der Inhalt wird entpackt und mit indiziert) + +Die vollständige Liste steht unter `Durchsuchbare Dateien `__. + +Dateien ganz ohne Text, etwa gescannte Dokumente und reine Bild-PDFs, lassen sich auf diesem Weg nicht lesen. Ob OCR nötig wird, klärt man am besten vorab an den tatsächlichen Inhalten der Zielordner. + +Dimensionierung und Aufbau +========================== + +Fess legt seinen Index in OpenSearch ab. Kleine Installationen laufen problemlos mit Fess und OpenSearch auf demselben Rechner; wächst der Bestand, lässt sich OpenSearch als Cluster herauslösen. + +Für die Dimensionierung ist die reine Dateizahl ein schlechter Anhaltspunkt. Diese drei Punkte wiegen schwerer: + +- Die Gesamtgröße der Zielordner und welcher Anteil davon überhaupt Text enthält +- Wie oft sich Inhalte ändern, täglich oder monatlich, denn das bestimmt den Crawl-Zeitplan +- Die Größe einzelner Dateien, da sehr große Dateien per Konfiguration vom Crawl ausgenommen werden können + +Erste Schritte +============== + +1. **Zuerst laufen lassen** — der `Schnellstart-Anleitung `__ folgen. Mit Docker Compose ist in wenigen Minuten etwas Durchsuchbares da +2. **Crawl-Konfiguration anlegen** — Ziel-URL und Crawl-Intervall unter [Crawler] > [Dateisystem] eintragen +3. **Zugangsdaten hinterlegen** — das Konto für die Freigabe unter [Crawler] > [Dateiauthentifizierung] eintragen +4. **Rollen und Labels entwerfen** — Labels für die Filterung nach Abteilung, Rollen für rechteabhängige Treffer + +Ein durchgearbeitetes Beispiel steht in `Teil 4 Verstreute Dateien zentral durchsuchen `__, das ein einziges Suchfeld über mehrere Dateiserver und eine Intranet-Seite aufbaut. + +Zusammenfassung +=============== + +- Fess ist ein quelloffener Suchserver, der Dateiserver über SMB/CIFS, FTP, lokale Pfade, S3 und GCS indizieren kann +- Bei über SMB gecrawlten Dateien filtern die in der ACL hinterlegten Zugriffsrechte die Treffer, und zwar standardmäßig +- Rechtebewusste Suche setzt die Anbindung an Active Directory oder LDAP voraus +- Apache Tika macht den Inhalt von Office-Dokumenten und PDFs durchsuchbar +- Klein anfangen und durch Auslagerung von OpenSearch in ein Cluster wachsen + +Weiterführende Hinweise +======================= + +- `Crawler-Konfiguration: Web-, Dateiserver- und Datenbank-Crawling `__ +- `Zugriffssteuerung über Rollen `__ +- `Durchsuchbare Dateien `__ +- `Schnellstart-Anleitung `__ +- `Administrationsleitfaden `__ diff --git a/de/guide.rst b/de/guide.rst index b1bd96038..955494551 100644 --- a/de/guide.rst +++ b/de/guide.rst @@ -51,6 +51,7 @@ Anwendungsfaelle und Beispiele - :doc:`articles/use-cases` - Branchenspezifische und groessenabhaengige Anwendungsfaelle - :doc:`articles/comparison` - Fess im Vergleich zu anderen Suchloesungen (Elasticsearch, Solr usw.) +- :doc:`articles/file-server-search` - Was vor einer Volltextsuche ueber Dateiserver zu pruefen ist .. toctree:: :hidden: @@ -80,3 +81,4 @@ Anwendungsfaelle und Beispiele articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search diff --git a/en/articles/file-server-search.rst b/en/articles/file-server-search.rst new file mode 100644 index 000000000..bcbcb4f75 --- /dev/null +++ b/en/articles/file-server-search.rst @@ -0,0 +1,156 @@ +============================================= +Open Source Full-Text Search for File Servers +============================================= + +Introduction +============ + +As departments add file servers, nobody can say where a given document lives any more. Windows search works one shared folder at a time and cannot reach across servers, and a NAS with its own full-text search stops at the edge of that box. + +One way out is to run a full-text search server in front of the file servers. This page collects the things worth checking before you put Fess, an open source full-text search server, in that position. + +Who this is for +=============== + +- Anyone struggling to search an internal file server or NAS +- Anyone evaluating full-text search and wondering whether open source can do the job +- Anyone who needs to add search without disturbing existing access permissions + +Fess is published under the Apache License 2.0 and carries no licence fee. + +Where the files can live +======================== + +The Fess file crawler speaks the protocols below. You configure them in the admin UI under [Crawler] > [File System], as the crawl start URL. + +.. list-table:: Supported protocols + :header-rows: 1 + :widths: 12 33 55 + + * - Protocol + - URL form + - Typical use + * - ``file`` + - ``file:///home/share/documents/`` + - A directory on the machine running Fess, including an already-mounted NAS + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Windows file sharing, from SMB 2.0.2 through SMB 3.1.1 + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - Older equipment that only speaks SMB1/CIFS + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - FTP servers + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 and S3-compatible object storage + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +The enabled set is held in ``crawler.file.protocols``, which defaults to ``file,smb,smb1,ftp,s3,gcs``. + +For Windows file sharing you normally want ``smb``. ``smb1`` is kept for old NAS boxes and print servers that speak nothing else; SMB1 is disabled by default in Windows for security reasons, so it is not something to choose for a new deployment. + +Existing access permissions carry over +====================================== + +The biggest worry when putting search in front of a file server is that documents somebody should not see will turn up in the results. If the HR and finance folders surface for everyone, the search system is unusable no matter how good the ranking is. + +Fess answers this by **carrying the file server's own access permissions into search**. + +How it works +------------ + +1. While crawling, Fess reads each file's ACL +2. The accounts and groups that are allowed or denied are recorded as that document's roles +3. At search time those roles are matched against the roles of the signed-in user, and only permitted documents come back + +Both allow and deny are handled, distinguished internally by the ``(allow)`` and ``(deny)`` prefixes. Reading roles out of the ACL is enabled by default. + +.. list-table:: Settings that govern permission inheritance + :header-rows: 1 + :widths: 38 14 48 + + * - Setting + - Default + - What it does + * - ``smb.role.from.file`` + - ``true`` + - Takes roles from the ACL of files crawled over SMB + * - ``file.role.from.file`` + - ``true`` + - Takes roles from local file system permissions + * - ``ftp.role.from.file`` + - ``true`` + - Takes roles from files crawled over FTP + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - Which SID types become roles; tunes how users and groups are treated + +The prerequisite to check first +------------------------------- + +For this to work end to end, **the person searching has to carry the same roles**. The document records "this group may read me", so unless the searching user can tell Fess which groups they belong to, there is nothing to match against. + +That makes **integration with Active Directory or LDAP a prerequisite** for permission-aware search: Fess signs users in against the same directory the file server authenticates them with. + +If instead you only ever index shared folders that everyone in the company may read, the integration is not required. That distinction is usually what decides the scope of a first deployment. + +Which file formats can be read +============================== + +Fess extracts text from file contents using Apache Tika, so the body of a document is searchable, not just its name. That is what lets somebody find a document whose title they cannot recall. + +The main formats are: + +- MS Office (doc, xls, ppt, docx, xlsx, pptx and so on) +- PDF +- Plain text, HTML, XML +- Rich text (rtf) +- Source code (js, c, h, java and so on) +- Archives (gz, tar, zip and so on; the contents are expanded and indexed too) + +The full list is on `Supported file types `__. + +Files that hold no text at all, such as scanned documents and image-only PDFs, cannot be read this way. Whether OCR is needed is worth settling by looking at what is actually in the target folders before you start. + +Sizing and topology +=================== + +Fess stores its index in OpenSearch. A small deployment runs happily with Fess and OpenSearch on the same machine, and OpenSearch can be split out into a cluster as the corpus grows. + +When sizing, the file count alone is a poor guide. These three matter more: + +- The total size of the target folders, and what share of it is text-bearing +- How often content changes, daily or monthly, which drives the crawl schedule +- Per-file size, since very large files can be excluded from crawling by configuration + +Getting started +=============== + +1. **Run it first** — follow `Quick Start `__. With Docker Compose you have something searchable in a few minutes +2. **Create a crawl configuration** — register the target URL and crawl interval under [Crawler] > [File System] +3. **Add credentials** — register the account used to reach the shared folder under [Crawler] > [File Authentication] +4. **Design roles and labels** — labels for departmental filtering, roles for permission-based results + +A worked example is in `Part 4: Unified Search for Scattered Files `__, which builds a single search box over several file servers and an intranet site. + +Summary +======= + +- Fess is an open source search server that can index file servers over SMB/CIFS, FTP, local paths, S3 and GCS +- For files crawled over SMB, the access permissions recorded in the ACL are used to filter results, and this is on by default +- Permission-aware search requires integration with Active Directory or LDAP +- Apache Tika makes the body of Office documents and PDFs searchable +- Start small and grow by moving OpenSearch into a cluster + +References +========== + +- `Crawler Configuration: Web, File Server and Database Crawling `__ +- `Access Control with Roles `__ +- `Supported file types `__ +- `Quick Start `__ +- `Administration Guide `__ diff --git a/en/guide.rst b/en/guide.rst index f76f9779d..d0bf73036 100644 --- a/en/guide.rst +++ b/en/guide.rst @@ -51,6 +51,7 @@ Use Cases & Examples - :doc:`articles/use-cases` - Industry-specific and scale-based use cases - :doc:`articles/comparison` - Fess vs other search solutions (Elasticsearch, Solr, etc.) +- :doc:`articles/file-server-search` - What to check before putting full-text search in front of a file server .. toctree:: :hidden: @@ -80,3 +81,4 @@ Use Cases & Examples articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search diff --git a/es/articles/file-server-search.rst b/es/articles/file-server-search.rst new file mode 100644 index 000000000..740153cc9 --- /dev/null +++ b/es/articles/file-server-search.rst @@ -0,0 +1,156 @@ +============================================== +Búsqueda open source en servidores de archivos +============================================== + +Introducción +============ + +A medida que cada departamento añade servidores de archivos, ya nadie sabe dónde está un documento concreto. La búsqueda de Windows trabaja sobre una carpeta compartida cada vez y no cruza la frontera entre servidores, y la búsqueda de texto completo de un NAS termina en la propia caja. + +Una salida es poner un servidor de búsqueda de texto completo delante de los servidores de archivos. Esta página reúne lo que conviene comprobar antes de dar ese papel a Fess, un servidor de búsqueda de texto completo de código abierto. + +A quién va dirigida +=================== + +- A quienes tienen dificultades para buscar en un servidor de archivos interno o un NAS +- A quienes evalúan la búsqueda de texto completo y se preguntan si el código abierto basta +- A quienes quieren añadir búsqueda sin alterar los permisos de acceso existentes + +Fess se publica bajo la licencia Apache 2.0 y no conlleva coste de licencia. + +Dónde pueden estar los archivos +=============================== + +El rastreador de archivos de Fess habla los siguientes protocolos. Se configuran en la interfaz de administración en [Rastreador] > [Sistema de archivos], como URL de inicio del rastreo. + +.. list-table:: Protocolos admitidos + :header-rows: 1 + :widths: 12 33 55 + + * - Protocolo + - Forma de la URL + - Uso habitual + * - ``file`` + - ``file:///home/share/documents/`` + - Un directorio de la máquina que ejecuta Fess, incluido un NAS ya montado + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Recursos compartidos de Windows, desde SMB 2.0.2 hasta SMB 3.1.1 + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - Equipos antiguos que solo hablan SMB1/CIFS + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - Servidores FTP + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 y almacenamiento de objetos compatible con S3 + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +El conjunto activo se define en ``crawler.file.protocols``, cuyo valor predeterminado es ``file,smb,smb1,ftp,s3,gcs``. + +Para los recursos compartidos de Windows lo normal es ``smb``. ``smb1`` se conserva para NAS y servidores de impresión antiguos que no hablan nada más; SMB1 está desactivado de forma predeterminada en Windows por motivos de seguridad, así que no es una opción para una instalación nueva. + +Los permisos de acceso existentes se heredan +============================================ + +La mayor preocupación al poner una búsqueda delante de un servidor de archivos es que aparezcan en los resultados documentos que alguien no debería ver. Si las carpetas de recursos humanos y de contabilidad salen para todo el mundo, el sistema de búsqueda es inservible por bueno que sea el orden de los resultados. + +Fess resuelve esto **llevando a la búsqueda los propios permisos de acceso del servidor de archivos**. + +Cómo funciona +------------- + +1. Durante el rastreo, Fess lee la lista de control de acceso (ACL) de cada archivo +2. Las cuentas y los grupos permitidos o denegados se registran como roles de ese documento +3. Al buscar, esos roles se comparan con los del usuario que ha iniciado sesión y solo vuelven los documentos permitidos + +Se tratan tanto el permiso como la denegación, distinguidos internamente por los prefijos ``(allow)`` y ``(deny)``. La lectura de roles desde la ACL está activada de forma predeterminada. + +.. list-table:: Ajustes que rigen la herencia de permisos + :header-rows: 1 + :widths: 38 14 48 + + * - Ajuste + - Predeterminado + - Efecto + * - ``smb.role.from.file`` + - ``true`` + - Toma los roles de la ACL de los archivos rastreados por SMB + * - ``file.role.from.file`` + - ``true`` + - Toma los roles de los permisos del sistema de archivos local + * - ``ftp.role.from.file`` + - ``true`` + - Toma los roles de los archivos rastreados por FTP + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - Qué tipos de SID se convierten en roles; ajusta el trato de usuarios y grupos + +El requisito que conviene comprobar primero +------------------------------------------- + +Para que la cadena funcione de extremo a extremo, **quien busca debe llevar los mismos roles**. El documento registra «este grupo puede leerme»; mientras el usuario que busca no pueda decirle a Fess a qué grupos pertenece, no hay nada que comparar. + +Por eso la **integración con Active Directory o LDAP es un requisito** para una búsqueda que respete los permisos: Fess autentica a los usuarios contra el mismo directorio que ya usa el servidor de archivos. + +En cambio, si solo se indexan carpetas compartidas que toda la empresa puede leer, la integración no hace falta. Esa distinción suele decidir el alcance de un primer despliegue. + +Qué formatos de archivo se leen +=============================== + +Fess extrae el texto del contenido de los archivos con Apache Tika, de modo que se puede buscar en el cuerpo del documento y no solo en su nombre. Eso es lo que permite encontrar un documento cuyo título ya nadie recuerda. + +Los formatos principales son: + +- MS Office (doc, xls, ppt, docx, xlsx, pptx, entre otros) +- PDF +- Texto plano, HTML, XML +- Texto enriquecido (rtf) +- Código fuente (js, c, h, java, entre otros) +- Archivos comprimidos (gz, tar, zip, entre otros; el contenido se expande y también se indexa) + +La lista completa está en `Archivos Objetivo de Búsqueda `__. + +Los archivos que no contienen texto alguno, como los documentos escaneados y los PDF formados solo por imágenes, no se pueden leer por esta vía. Conviene decidir si hace falta OCR mirando antes qué hay realmente en las carpetas de destino. + +Dimensionamiento y arquitectura +=============================== + +Fess guarda su índice en OpenSearch. Una instalación pequeña funciona sin problema con Fess y OpenSearch en la misma máquina, y OpenSearch se puede separar en un clúster cuando el volumen crece. + +Para dimensionar, el número de archivos por sí solo es mala guía. Estos tres puntos pesan más: + +- El tamaño total de las carpetas de destino y qué parte contiene realmente texto +- Con qué frecuencia cambia el contenido, a diario o al mes, lo que determina la planificación del rastreo +- El tamaño de cada archivo, ya que los muy grandes se pueden excluir del rastreo por configuración + +Cómo empezar +============ + +1. **Ponerlo en marcha primero** — seguir la `Guía de Configuración Rápida `__. Con Docker Compose se obtiene algo consultable en pocos minutos +2. **Crear una configuración de rastreo** — registrar la URL de destino y el intervalo en [Rastreador] > [Sistema de archivos] +3. **Registrar las credenciales** — dar de alta la cuenta de acceso al recurso compartido en [Rastreador] > [Autenticación de archivos] +4. **Diseñar roles y etiquetas** — etiquetas para filtrar por departamento, roles para resultados según permisos + +Hay un ejemplo desarrollado en `Parte 4: Buscar archivos dispersos de forma centralizada `__, que construye un único cuadro de búsqueda sobre varios servidores de archivos y un sitio de intranet. + +Resumen +======= + +- Fess es un servidor de búsqueda de código abierto capaz de indexar servidores de archivos por SMB/CIFS, FTP, rutas locales, S3 y GCS +- En los archivos rastreados por SMB, los permisos registrados en la ACL filtran los resultados, y esto viene activado de fábrica +- La búsqueda que respeta los permisos exige integración con Active Directory o LDAP +- Apache Tika hace consultable el cuerpo de los documentos de Office y los PDF +- Empezar en pequeño y crecer separando OpenSearch en un clúster + +Referencias +=========== + +- `Configuración del Rastreador: Rastreo Web, de Servidores de Archivos y de Bases de Datos `__ +- `Control de acceso mediante roles `__ +- `Archivos Objetivo de Búsqueda `__ +- `Guía de Configuración Rápida `__ +- `Guía de administración `__ diff --git a/es/guide.rst b/es/guide.rst index e4da28edd..d7625d2a8 100644 --- a/es/guide.rst +++ b/es/guide.rst @@ -51,6 +51,7 @@ Casos de uso y ejemplos - :doc:`articles/use-cases` - Casos de uso por sector y tamano de empresa - :doc:`articles/comparison` - Comparacion de Fess con otras soluciones de busqueda (Elasticsearch, Solr, etc.) +- :doc:`articles/file-server-search` - Que comprobar antes de buscar en servidores de archivos .. toctree:: :hidden: @@ -80,3 +81,4 @@ Casos de uso y ejemplos articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search diff --git a/fr/articles/file-server-search.rst b/fr/articles/file-server-search.rst new file mode 100644 index 000000000..22ffd73da --- /dev/null +++ b/fr/articles/file-server-search.rst @@ -0,0 +1,156 @@ +=============================================== +Recherche plein texte pour serveurs de fichiers +=============================================== + +Introduction +============ + +À mesure que les services ajoutent des serveurs de fichiers, plus personne ne sait où se trouve tel ou tel document. La recherche de Windows ne travaille que dans un dossier partagé à la fois et ne franchit pas les frontières entre serveurs ; la recherche plein texte d'un NAS s'arrête au boîtier. + +Une solution consiste à placer un serveur de recherche plein texte devant les serveurs de fichiers. Cette page réunit ce qu'il faut vérifier avant de confier ce rôle à Fess, un serveur de recherche plein texte open source. + +À qui s'adresse cette page +========================== + +- À celles et ceux qui peinent à chercher sur un serveur de fichiers interne ou un NAS +- À celles et ceux qui évaluent la recherche plein texte et se demandent si l'open source suffit +- À celles et ceux qui veulent ajouter la recherche sans toucher aux droits d'accès existants + +Fess est publié sous licence Apache 2.0 et n'entraîne aucun coût de licence. + +Où les fichiers peuvent se trouver +================================== + +Le robot de fichiers de Fess parle les protocoles suivants. Ils se configurent dans l'interface d'administration sous [Robot] > [Système de fichiers], comme URL de départ de l'exploration. + +.. list-table:: Protocoles pris en charge + :header-rows: 1 + :widths: 12 33 55 + + * - Protocole + - Forme de l'URL + - Usage courant + * - ``file`` + - ``file:///home/share/documents/`` + - Un répertoire de la machine qui exécute Fess, y compris un NAS déjà monté + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Partages de fichiers Windows, de SMB 2.0.2 à SMB 3.1.1 + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - Matériel ancien qui ne parle que SMB1/CIFS + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - Serveurs FTP + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 et stockage objet compatible S3 + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +L'ensemble activé est décrit par ``crawler.file.protocols``, dont la valeur par défaut est ``file,smb,smb1,ftp,s3,gcs``. + +Pour les partages Windows, ``smb`` est le choix habituel. ``smb1`` subsiste pour les vieux NAS et serveurs d'impression qui ne parlent rien d'autre ; SMB1 est désactivé par défaut dans Windows pour des raisons de sécurité et n'est donc pas un choix à retenir pour une nouvelle installation. + +Les droits d'accès existants sont repris +======================================== + +La plus grande crainte, lorsqu'on met une recherche devant un serveur de fichiers, est de voir apparaître dans les résultats des documents que l'on ne devrait pas voir. Si les dossiers des ressources humaines et de la comptabilité remontent pour tout le monde, le système de recherche est inutilisable, quelle que soit la qualité du classement. + +Fess répond à cela en **reprenant dans la recherche les droits d'accès du serveur de fichiers lui-même**. + +Principe de fonctionnement +-------------------------- + +1. Pendant l'exploration, Fess lit la liste de contrôle d'accès (ACL) de chaque fichier +2. Les comptes et groupes autorisés ou refusés sont enregistrés comme rôles du document +3. Au moment de la recherche, ces rôles sont comparés à ceux de l'utilisateur connecté, et seuls les documents autorisés sont renvoyés + +L'autorisation et le refus sont tous deux traités, distingués en interne par les préfixes ``(allow)`` et ``(deny)``. La lecture des rôles depuis l'ACL est active par défaut. + +.. list-table:: Réglages qui gouvernent la reprise des droits + :header-rows: 1 + :widths: 38 14 48 + + * - Réglage + - Défaut + - Effet + * - ``smb.role.from.file`` + - ``true`` + - Reprend les rôles depuis l'ACL des fichiers explorés en SMB + * - ``file.role.from.file`` + - ``true`` + - Reprend les rôles depuis les permissions du système de fichiers local + * - ``ftp.role.from.file`` + - ``true`` + - Reprend les rôles depuis les fichiers explorés en FTP + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - Quels types de SID deviennent des rôles ; règle le traitement des utilisateurs et des groupes + +Le prérequis à vérifier en premier +---------------------------------- + +Pour que la chaîne soit complète, **la personne qui cherche doit porter les mêmes rôles**. Le document indique « ce groupe peut me lire » ; tant que l'utilisateur qui cherche ne peut pas dire à Fess à quels groupes il appartient, il n'y a rien à comparer. + +L'**intégration à Active Directory ou LDAP est donc un prérequis** pour une recherche respectueuse des droits : Fess authentifie les utilisateurs auprès de l'annuaire qui sert déjà au serveur de fichiers. + +En revanche, si l'on n'indexe que des dossiers partagés que toute l'entreprise peut lire, cette intégration n'est pas nécessaire. C'est en général cette distinction qui fixe le périmètre d'un premier déploiement. + +Quels formats de fichiers sont lus +================================== + +Fess extrait le texte du contenu des fichiers avec Apache Tika : c'est le corps du document qui devient consultable, et pas seulement son nom. C'est ce qui permet de retrouver un document dont plus personne ne se rappelle le titre. + +Les principaux formats sont : + +- MS Office (doc, xls, ppt, docx, xlsx, pptx, etc.) +- PDF +- Texte brut, HTML, XML +- Texte enrichi (rtf) +- Code source (js, c, h, java, etc.) +- Archives (gz, tar, zip, etc. ; le contenu est décompressé puis indexé) + +La liste complète figure sur `Fichiers recherchables `__. + +Les fichiers qui ne contiennent aucun texte, comme les documents numérisés et les PDF constitués d'images, ne peuvent pas être lus ainsi. Mieux vaut déterminer si l'OCR est nécessaire en examinant le contenu réel des dossiers visés avant de commencer. + +Dimensionnement et architecture +=============================== + +Fess range son index dans OpenSearch. Une petite installation fonctionne très bien avec Fess et OpenSearch sur la même machine, et OpenSearch peut être détaché en grappe lorsque le volume augmente. + +Pour dimensionner, le seul nombre de fichiers est un mauvais indicateur. Ces trois points comptent davantage : + +- La taille totale des dossiers visés, et la part qui contient réellement du texte +- La fréquence des modifications, quotidienne ou mensuelle, qui détermine le calendrier d'exploration +- La taille unitaire des fichiers, les très gros pouvant être exclus de l'exploration par configuration + +Pour commencer +============== + +1. **Le faire tourner d'abord** — suivre le `Guide de construction rapide `__. Avec Docker Compose, on obtient en quelques minutes quelque chose d'interrogeable +2. **Créer une configuration d'exploration** — enregistrer l'URL visée et l'intervalle sous [Robot] > [Système de fichiers] +3. **Renseigner les identifiants** — enregistrer le compte d'accès au partage sous [Robot] > [Authentification de fichiers] +4. **Concevoir rôles et étiquettes** — les étiquettes pour filtrer par service, les rôles pour les résultats selon les droits + +Un exemple déroulé se trouve dans `Partie 4 : Recherche unifiée dans des fichiers dispersés `__, qui construit un champ de recherche unique au-dessus de plusieurs serveurs de fichiers et d'un site intranet. + +Résumé +====== + +- Fess est un serveur de recherche open source capable d'indexer des serveurs de fichiers en SMB/CIFS, FTP, chemins locaux, S3 et GCS +- Pour les fichiers explorés en SMB, les droits d'accès inscrits dans l'ACL filtrent les résultats, et ce par défaut +- La recherche respectueuse des droits suppose une intégration à Active Directory ou LDAP +- Apache Tika rend consultable le corps des documents Office et des PDF +- Commencer petit, puis grandir en détachant OpenSearch en grappe + +Références +========== + +- `Configuration du robot : exploration Web, serveur de fichiers et base de données `__ +- `Contrôle d'accès par rôles `__ +- `Fichiers recherchables `__ +- `Guide de construction rapide `__ +- `Guide d'administration `__ diff --git a/fr/guide.rst b/fr/guide.rst index ad455a48b..5a578ae97 100644 --- a/fr/guide.rst +++ b/fr/guide.rst @@ -51,6 +51,7 @@ Cas d'utilisation et exemples - :doc:`articles/use-cases` - Cas d'utilisation par secteur et par taille d'entreprise - :doc:`articles/comparison` - Comparaison de Fess avec d'autres solutions de recherche (Elasticsearch, Solr, etc.) +- :doc:`articles/file-server-search` - Ce qu'il faut verifier avant une recherche plein texte sur serveurs de fichiers .. toctree:: :hidden: @@ -80,3 +81,4 @@ Cas d'utilisation et exemples articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search diff --git a/ja/articles/file-server-search.rst b/ja/articles/file-server-search.rst new file mode 100644 index 000000000..bd79ffba2 --- /dev/null +++ b/ja/articles/file-server-search.rst @@ -0,0 +1,156 @@ +============================================== +オープンソースで実現するファイルサーバ全文検索 +============================================== + +はじめに +======== + +部門ごとにファイルサーバが増えていくと、「あの資料はどこにあるか」が誰にも分からなくなります。Windows の検索は共有フォルダ単位でしか働かず、サーバが複数あれば横断できません。NAS の全文検索機能も、機器をまたぐと使えません。 + +この問題を解決する方法のひとつが、ファイルサーバ専用の全文検索サーバを立てることです。本ページでは、オープンソースの全文検索サーバ Fess でファイルサーバを検索対象にする場合に、導入前に確認しておきたい点をまとめます。 + +対象読者 +======== + +- 社内のファイルサーバや NAS の検索に困っている方 +- 全文検索の導入を検討していて、オープンソースで実現できるか知りたい方 +- 既存のアクセス権限を壊さずに検索を導入したい方 + +Fess は Apache License 2.0 で公開されており、ライセンス費用なしで利用できます。 + +どこに置かれたファイルを検索できるか +==================================== + +Fess のファイルクロールは、以下のプロトコルに対応しています。設定は管理画面の [クローラー] > [ファイルシステム] で、クロール開始 URL として指定します。 + +.. list-table:: 対応プロトコル + :header-rows: 1 + :widths: 12 33 55 + + * - プロトコル + - URL の書式 + - 主な用途 + * - ``file`` + - ``file:///home/share/documents/`` + - Fess を動かすサーバ上のディレクトリ。マウント済みの NAS もここに含まれます + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Windows ファイル共有。SMB 2.0.2 から SMB 3.1.1 までに対応します + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - SMB1/CIFS しか話せない古い機器向け + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - FTP サーバ + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 および S3 互換のオブジェクトストレージ + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +有効なプロトコルは設定値 ``crawler.file.protocols`` で管理されており、既定値は ``file,smb,smb1,ftp,s3,gcs`` です。 + +Windows ファイル共有を検索する場合、通常は ``smb`` を使います。``smb1`` は SMB1 しか話せない古い NAS やプリントサーバのために残されているもので、SMB1 はセキュリティ上の理由から Windows でも既定で無効化されているため、新規に選ぶものではありません。 + +既存のアクセス権限をそのまま引き継ぐ +==================================== + +ファイルサーバに検索を導入するとき、いちばん大きな懸念は「見えてはいけない文書が検索結果に出てしまうこと」です。人事や経理の共有フォルダが全社員の検索結果に並んでしまえば、検索システムそのものが使えません。 + +Fess はこれを、\ **ファイルサーバ側のアクセス権限をそのまま検索に持ち込む**\ という方法で解決します。 + +仕組み +------ + +1. クロール時に、Fess は各ファイルの ACL(アクセス制御リスト)を読み取ります +2. 許可・拒否されているアカウントとグループを、その文書の「ロール」として記録します +3. 検索時に、ログインしているユーザーが持つロールと突き合わせ、権限のある文書だけを返します + +許可と拒否の両方が扱われ、内部的には ``(allow)`` と ``(deny)`` のプレフィックスで区別されます。ACL からロールを取り出す動作は既定で有効です。 + +.. list-table:: 権限の引き継ぎに関する設定値 + :header-rows: 1 + :widths: 38 14 48 + + * - 設定値 + - 既定値 + - 内容 + * - ``smb.role.from.file`` + - ``true`` + - SMB でクロールしたファイルの ACL からロールを取得します + * - ``file.role.from.file`` + - ``true`` + - ローカルファイルシステムのパーミッションからロールを取得します + * - ``ftp.role.from.file`` + - ``true`` + - FTP でクロールしたファイルからロールを取得します + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - ロールとして採用する SID の種類。ユーザーとグループの扱いを調整します + +導入前に確認すべき前提 +---------------------- + +この仕組みが最後まで機能するには、\ **検索する側のユーザーにも同じロールが付いている必要があります**\ 。文書側には「このグループなら読める」と記録されているので、検索するユーザーが自分の所属グループを Fess に伝えられなければ突き合わせができません。 + +そのため、権限を引き継いだ検索を行うには **Active Directory や LDAP との連携が前提**\ になります。ファイルサーバの認証に使っているディレクトリと同じものを Fess のログインにも使う、という構成です。 + +逆に、全社員が同じ範囲を見てよい共有フォルダだけを対象にするのであれば、この連携は必須ではありません。導入範囲を決めるときの分かれ目になります。 + +どのファイル形式の中身まで読めるか +================================== + +Fess は Apache Tika を利用して、ファイルの中身からテキストを抽出します。ファイル名だけでなく本文が検索対象になるため、「タイトルを思い出せない資料」も見つけられます。 + +主な対応形式は次のとおりです。 + +- MS Office(doc, xls, ppt, docx, xlsx, pptx など) +- PDF +- テキスト、HTML、XML +- リッチテキスト(rtf) +- ソースコード(js, c, h, java など) +- 圧縮ファイル(gz, tar, zip など。展開して中身も対象になります) + +網羅した一覧は `検索対象ファイル `__ を参照してください。 + +画像 PDF やスキャン文書のように、そもそもテキストを含まないファイルは、この方法では中身を読めません。OCR が必要になるケースかどうかは、対象フォルダの実態を先に確認しておくことをおすすめします。 + +構成と規模 +========== + +Fess は検索インデックスの格納に OpenSearch を使います。小規模であれば Fess と OpenSearch を同じサーバに同居させる構成で動きますが、対象ファイルが増えてきた場合は OpenSearch をクラスター構成にして分離できます。 + +規模を見積もるときは、ファイル数だけでなく次の点を確認しておくと精度が上がります。 + +- 対象フォルダの合計サイズと、そのうちテキストを含むファイルの割合 +- 更新頻度(毎日変わるのか、月に数回か)。クロール間隔の設計に影響します +- 1 ファイルあたりのサイズ。極端に大きなファイルはクロール対象から外す設定ができます + +導入の流れ +========== + +1. **まず動かす** — `クイックスタート `__ の手順で Fess を起動します。Docker Compose を使えば数分で検索できる状態になります +2. **クロール設定を作る** — 管理画面の [クローラー] > [ファイルシステム] で、対象の URL とクロール間隔を登録します +3. **認証情報を設定する** — 共有フォルダにアクセスするためのアカウントを [クローラー] > [ファイル認証] に登録します +4. **権限とラベルを設計する** — 部門別の絞り込みが必要であればラベルを、権限による出し分けが必要であればロールを設定します + +手順を追って構築する例は `第4回 散在するファイルを一元検索 `__ で扱っています。複数のファイルサーバと社内 Web サイトをまとめて 1 つの検索窓から探せるようにするところまでを通しで説明しています。 + +まとめ +====== + +- Fess はファイルサーバ(SMB/CIFS、FTP、ローカル、S3、GCS)を全文検索の対象にできるオープンソースの検索サーバです +- SMB でクロールしたファイルは、ACL に記録されたアクセス権限がそのまま検索結果の出し分けに使われます。この動作は既定で有効です +- 権限を引き継いだ検索を行うには、Active Directory や LDAP との連携が前提になります +- Apache Tika により、Office 文書や PDF の本文まで検索対象になります +- 小さく始めて、対象が増えたら OpenSearch をクラスター化して広げられます + +参考資料 +======== + +- `クローラー設定:Web、ファイルサーバー、データベースクロール `__ +- `ロールによるアクセス制御 `__ +- `検索対象ファイル `__ +- `クイックスタート `__ +- `管理画面ガイド `__ diff --git a/ja/guide.rst b/ja/guide.rst index 5ececb7b1..f3abfb30d 100644 --- a/ja/guide.rst +++ b/ja/guide.rst @@ -51,6 +51,7 @@ Fess で実現するナレッジ活用戦略 - :doc:`articles/use-cases` - 業種別・規模別の活用事例とユースケース - :doc:`articles/comparison` - Fess と他の検索ソリューション(Elasticsearch、Solr 等)の比較 +- :doc:`articles/file-server-search` - ファイルサーバの全文検索を導入する前に確認すべき点 .. toctree:: :hidden: @@ -80,3 +81,4 @@ Fess で実現するナレッジ活用戦略 articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search diff --git a/ko/articles/file-server-search.rst b/ko/articles/file-server-search.rst new file mode 100644 index 000000000..ada9d4640 --- /dev/null +++ b/ko/articles/file-server-search.rst @@ -0,0 +1,156 @@ +======================================= +오픈소스로 구현하는 파일 서버 전문 검색 +======================================= + +들어가며 +======== + +부서마다 파일 서버가 늘어날수록 "그 자료가 어디에 있는지" 아무도 알 수 없게 됩니다. Windows 검색은 공유 폴더 단위로만 동작해서 서버가 여러 대면 가로지를 수 없고, NAS의 전문 검색 기능도 장비를 넘어가면 쓸 수 없습니다. + +이 문제를 푸는 방법 중 하나가 파일 서버 앞에 전문 검색 서버를 두는 것입니다. 이 페이지에서는 오픈소스 전문 검색 서버인 Fess를 그 자리에 놓기 전에 확인해 두어야 할 점을 정리합니다. + +대상 독자 +========= + +- 사내 파일 서버나 NAS 검색에 어려움을 겪고 있는 분 +- 전문 검색 도입을 검토 중이며 오픈소스로 해결할 수 있는지 알고 싶은 분 +- 기존 접근 권한을 건드리지 않고 검색을 도입하고 싶은 분 + +Fess는 Apache License 2.0으로 공개되어 있으며 라이선스 비용이 들지 않습니다. + +어디에 있는 파일을 검색할 수 있는가 +=================================== + +Fess의 파일 크롤링은 다음 프로토콜을 지원합니다. 설정은 관리 화면의 [크롤러] > [파일 시스템]에서 크롤링 시작 URL로 지정합니다. + +.. list-table:: 지원 프로토콜 + :header-rows: 1 + :widths: 12 33 55 + + * - 프로토콜 + - URL 형식 + - 주요 용도 + * - ``file`` + - ``file:///home/share/documents/`` + - Fess를 실행하는 서버상의 디렉터리. 마운트된 NAS도 여기에 포함됩니다 + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Windows 파일 공유. SMB 2.0.2부터 SMB 3.1.1까지 지원합니다 + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - SMB1/CIFS만 지원하는 오래된 장비용 + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - FTP 서버 + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 및 S3 호환 오브젝트 스토리지 + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +활성화된 프로토콜은 설정값 ``crawler.file.protocols``\ 로 관리되며, 기본값은 ``file,smb,smb1,ftp,s3,gcs``\ 입니다. + +Windows 파일 공유를 검색할 때는 보통 ``smb``\ 를 사용합니다. ``smb1``\ 은 SMB1만 지원하는 오래된 NAS나 프린트 서버를 위해 남겨 둔 것으로, SMB1은 보안상의 이유로 Windows에서도 기본 비활성화되어 있으므로 새로 선택할 대상은 아닙니다. + +기존 접근 권한을 그대로 이어받는다 +================================== + +파일 서버에 검색을 도입할 때 가장 큰 걱정은 "보여서는 안 되는 문서가 검색 결과에 나오는 것"입니다. 인사나 회계 공유 폴더가 전 직원의 검색 결과에 뜬다면, 순위가 아무리 좋아도 그 검색 시스템은 쓸 수 없습니다. + +Fess는 이를 \ **파일 서버 쪽 접근 권한을 그대로 검색에 가져오는**\ 방식으로 해결합니다. + +동작 방식 +--------- + +1. 크롤링할 때 Fess는 각 파일의 ACL(접근 제어 목록)을 읽습니다 +2. 허용되거나 거부된 계정과 그룹을 그 문서의 "롤"로 기록합니다 +3. 검색할 때 로그인한 사용자가 가진 롤과 대조하여 권한이 있는 문서만 돌려줍니다 + +허용과 거부가 모두 처리되며, 내부적으로는 ``(allow)`` 와 ``(deny)`` 접두사로 구분됩니다. ACL에서 롤을 가져오는 동작은 기본적으로 활성화되어 있습니다. + +.. list-table:: 권한 승계 관련 설정값 + :header-rows: 1 + :widths: 38 14 48 + + * - 설정값 + - 기본값 + - 내용 + * - ``smb.role.from.file`` + - ``true`` + - SMB로 크롤링한 파일의 ACL에서 롤을 가져옵니다 + * - ``file.role.from.file`` + - ``true`` + - 로컬 파일 시스템의 권한에서 롤을 가져옵니다 + * - ``ftp.role.from.file`` + - ``true`` + - FTP로 크롤링한 파일에서 롤을 가져옵니다 + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - 롤로 채택할 SID 종류. 사용자와 그룹의 처리 방식을 조정합니다 + +먼저 확인해야 할 전제 +--------------------- + +이 구조가 끝까지 동작하려면 \ **검색하는 쪽 사용자에게도 같은 롤이 있어야 합니다**\ . 문서에는 "이 그룹이면 읽을 수 있다"고 기록되어 있으므로, 검색하는 사용자가 자신의 소속 그룹을 Fess에 전달하지 못하면 대조할 대상이 없습니다. + +따라서 권한을 이어받은 검색을 하려면 \ **Active Directory나 LDAP 연동이 전제**\ 가 됩니다. 파일 서버 인증에 쓰는 디렉터리를 Fess 로그인에도 그대로 사용하는 구성입니다. + +반대로 전 직원이 같은 범위를 봐도 되는 공유 폴더만 대상으로 한다면 이 연동은 필수가 아닙니다. 도입 범위를 정할 때 갈리는 지점입니다. + +어떤 파일 형식의 내용까지 읽을 수 있는가 +======================================== + +Fess는 Apache Tika를 이용해 파일 내용에서 텍스트를 추출합니다. 파일 이름뿐 아니라 본문이 검색 대상이 되므로 "제목이 기억나지 않는 자료"도 찾을 수 있습니다. + +주요 지원 형식은 다음과 같습니다. + +- MS Office(doc, xls, ppt, docx, xlsx, pptx 등) +- PDF +- 텍스트, HTML, XML +- 리치 텍스트(rtf) +- 소스 코드(js, c, h, java 등) +- 압축 파일(gz, tar, zip 등. 압축을 풀어 내용도 대상이 됩니다) + +전체 목록은 `검색 대상 파일 `__ 을 참조하세요. + +스캔 문서나 이미지로만 된 PDF처럼 애초에 텍스트를 포함하지 않는 파일은 이 방식으로 내용을 읽을 수 없습니다. OCR이 필요한 경우인지는 대상 폴더의 실제 내용을 먼저 확인해 두기를 권합니다. + +구성과 규모 +=========== + +Fess는 검색 인덱스 저장에 OpenSearch를 사용합니다. 규모가 작다면 Fess와 OpenSearch를 같은 서버에 함께 두는 구성으로도 동작하며, 대상 파일이 늘어나면 OpenSearch를 클러스터로 분리할 수 있습니다. + +규모를 산정할 때는 파일 수만이 아니라 다음 항목을 확인하면 정확도가 올라갑니다. + +- 대상 폴더의 총 용량과 그중 텍스트를 포함한 파일의 비율 +- 갱신 빈도(매일 바뀌는지, 한 달에 몇 번인지). 크롤링 간격 설계에 영향을 줍니다 +- 파일 하나당 크기. 지나치게 큰 파일은 크롤링 대상에서 제외하는 설정이 가능합니다 + +도입 흐름 +========= + +1. **먼저 실행해 본다** — `빠른 구축 가이드 `__ 의 순서로 Fess를 기동합니다. Docker Compose를 쓰면 몇 분 만에 검색할 수 있는 상태가 됩니다 +2. **크롤링 설정을 만든다** — 관리 화면의 [크롤러] > [파일 시스템]에서 대상 URL과 크롤링 간격을 등록합니다 +3. **인증 정보를 설정한다** — 공유 폴더에 접근할 계정을 [크롤러] > [파일 인증]에 등록합니다 +4. **권한과 라벨을 설계한다** — 부서별 좁히기가 필요하면 라벨을, 권한에 따른 노출 제어가 필요하면 롤을 설정합니다 + +순서를 따라 구축하는 예는 `제4회 흩어진 파일을 일원 검색 `__ 에서 다룹니다. 여러 파일 서버와 사내 웹 사이트를 하나의 검색창에서 찾을 수 있게 하는 데까지 전 과정을 설명합니다. + +정리 +==== + +- Fess는 파일 서버(SMB/CIFS, FTP, 로컬, S3, GCS)를 전문 검색 대상으로 삼을 수 있는 오픈소스 검색 서버입니다 +- SMB로 크롤링한 파일은 ACL에 기록된 접근 권한이 그대로 검색 결과 노출 제어에 사용되며, 이 동작은 기본적으로 활성화되어 있습니다 +- 권한을 이어받은 검색을 하려면 Active Directory나 LDAP 연동이 전제가 됩니다 +- Apache Tika를 통해 Office 문서나 PDF의 본문까지 검색 대상이 됩니다 +- 작게 시작해서 대상이 늘어나면 OpenSearch를 클러스터로 확장할 수 있습니다 + +참고 자료 +========= + +- `크롤러 설정: 웹, 파일 서버, 데이터베이스 크롤링 `__ +- `롤을 이용한 접근 제어 `__ +- `검색 대상 파일 `__ +- `빠른 구축 가이드 `__ +- `관리 화면 가이드 `__ diff --git a/ko/guide.rst b/ko/guide.rst index e617af649..f4f541b7e 100644 --- a/ko/guide.rst +++ b/ko/guide.rst @@ -51,6 +51,7 @@ Fess로 실현하는 지식 활용 전략 - :doc:`articles/use-cases` - 업종별, 규모별 활용 사례 - :doc:`articles/comparison` - Fess와 다른 검색 솔루션 비교 (Elasticsearch, Solr 등) +- :doc:`articles/file-server-search` - 파일 서버 전문 검색을 도입하기 전에 확인할 점 .. toctree:: :hidden: @@ -80,3 +81,4 @@ Fess로 실현하는 지식 활용 전략 articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search diff --git a/zh-cn/articles/file-server-search.rst b/zh-cn/articles/file-server-search.rst new file mode 100644 index 000000000..d8afdcdda --- /dev/null +++ b/zh-cn/articles/file-server-search.rst @@ -0,0 +1,156 @@ +================================ +用开源方案实现文件服务器全文检索 +================================ + +前言 +==== + +随着各部门不断增加文件服务器,"那份资料放在哪里"逐渐变得无人知晓。Windows 搜索只能在单个共享文件夹内工作,服务器一多就无法横跨;NAS 自带的全文检索功能也止步于设备本身。 + +解决这个问题的方法之一,是在文件服务器前面架设一台全文检索服务器。本页整理了把开源全文检索服务器 Fess 放到这个位置之前,需要事先确认的要点。 + +适用读者 +======== + +- 为公司内部文件服务器或 NAS 的检索而困扰的人 +- 正在考察全文检索,想知道开源方案是否够用的人 +- 希望在不改动现有访问权限的前提下引入检索的人 + +Fess 以 Apache License 2.0 公开,无需许可费用。 + +可以检索放在哪里的文件 +====================== + +Fess 的文件爬取支持以下协议。在管理界面的 [爬虫] > [文件系统] 中,作为爬取起始 URL 指定。 + +.. list-table:: 支持的协议 + :header-rows: 1 + :widths: 12 33 55 + + * - 协议 + - URL 格式 + - 主要用途 + * - ``file`` + - ``file:///home/share/documents/`` + - 运行 Fess 的服务器上的目录,已挂载的 NAS 也包含在内 + * - ``smb`` + - ``smb://fileserver.example.com/share/`` + - Windows 文件共享,支持 SMB 2.0.2 到 SMB 3.1.1 + * - ``smb1`` + - ``smb1://fileserver.example.com/share/`` + - 只能使用 SMB1/CIFS 的老旧设备 + * - ``ftp`` + - ``ftp://fileserver.example.com/pub/`` + - FTP 服务器 + * - ``s3`` + - ``s3://bucket-name/prefix/`` + - Amazon S3 以及兼容 S3 的对象存储 + * - ``gcs`` + - ``gcs://bucket-name/prefix/`` + - Google Cloud Storage + +启用哪些协议由配置项 ``crawler.file.protocols`` 管理,默认值为 ``file,smb,smb1,ftp,s3,gcs`` 。 + +检索 Windows 文件共享时通常使用 ``smb`` 。``smb1`` 是为只能使用 SMB1 的老旧 NAS 和打印服务器保留的;出于安全原因,SMB1 在 Windows 上也已默认停用,因此不应作为新建环境的选择。 + +原有的访问权限被原样继承 +======================== + +在文件服务器上引入检索时,最大的顾虑是"不该被看到的文档出现在检索结果里"。如果人事和财务的共享文件夹出现在全体员工的检索结果中,那么排序做得再好,这套检索系统也无法使用。 + +Fess 通过\ **把文件服务器一侧的访问权限原样带入检索**\ 来解决这个问题。 + +工作原理 +-------- + +1. 爬取时,Fess 读取每个文件的 ACL(访问控制列表) +2. 把被允许和被拒绝的账户与组,记录为该文档的"角色" +3. 检索时与登录用户所持有的角色进行比对,只返回有权限的文档 + +允许和拒绝都会被处理,内部通过 ``(allow)`` 和 ``(deny)`` 前缀加以区分。从 ACL 中取出角色的行为默认启用。 + +.. list-table:: 与权限继承相关的配置项 + :header-rows: 1 + :widths: 38 14 48 + + * - 配置项 + - 默认值 + - 说明 + * - ``smb.role.from.file`` + - ``true`` + - 从通过 SMB 爬取的文件的 ACL 中取得角色 + * - ``file.role.from.file`` + - ``true`` + - 从本地文件系统的权限中取得角色 + * - ``ftp.role.from.file`` + - ``true`` + - 从通过 FTP 爬取的文件中取得角色 + * - ``smb.available.sid.types`` + - ``1,2,4:2,5:1`` + - 采用为角色的 SID 种类,用于调整用户与组的处理方式 + +需要先确认的前提 +---------------- + +要让这套机制完整生效,\ **检索一方的用户也必须持有相同的角色**\ 。文档一侧记录的是"属于这个组就可以读",因此如果检索用户无法把自己所属的组告知 Fess,就没有可供比对的对象。 + +因此,要实现继承权限的检索,\ **与 Active Directory 或 LDAP 的对接是前提**\ 。也就是让 Fess 的登录使用与文件服务器认证相同的目录服务。 + +反过来说,如果只针对全体员工都可以查看的共享文件夹,则不必进行这项对接。这一点往往是划定首次引入范围的分界线。 + +能读取到哪些文件格式的内容 +========================== + +Fess 利用 Apache Tika 从文件内容中提取文本。检索对象不只是文件名,还包括正文,因此"想不起标题的资料"也能找到。 + +主要支持的格式如下。 + +- MS Office(doc、xls、ppt、docx、xlsx、pptx 等) +- PDF +- 文本、HTML、XML +- 富文本(rtf) +- 源代码(js、c、h、java 等) +- 压缩文件(gz、tar、zip 等,会解压后把内容一并纳入对象) + +完整列表请参阅 `搜索对象文件 `__ 。 + +扫描件、纯图片 PDF 这类本身不含文本的文件,无法通过这种方式读取内容。是否需要 OCR,建议先确认目标文件夹的实际情况再判断。 + +架构与规模 +========== + +Fess 使用 OpenSearch 存放检索索引。规模较小时,Fess 与 OpenSearch 部署在同一台服务器上即可运行;当对象文件增多后,可以把 OpenSearch 拆分为集群。 + +估算规模时,只看文件数量并不准确。确认以下几点会更有把握。 + +- 目标文件夹的总容量,以及其中含有文本的文件所占比例 +- 更新频率(每天变化还是每月数次),这会影响爬取间隔的设计 +- 单个文件的大小,过大的文件可以通过配置排除在爬取对象之外 + +引入步骤 +======== + +1. **先跑起来** — 按照 `快速构建指南 `__ 的步骤启动 Fess。使用 Docker Compose 只需几分钟就能进入可检索状态 +2. **创建爬取配置** — 在管理界面的 [爬虫] > [文件系统] 中登记目标 URL 和爬取间隔 +3. **设置认证信息** — 在 [爬虫] > [文件认证] 中登记访问共享文件夹所用的账户 +4. **设计权限与标签** — 需要按部门筛选就设置标签,需要按权限区分展示就设置角色 + +按步骤搭建的示例见 `第4回 统一检索分散的文件 `__ ,其中完整说明了如何把多台文件服务器和公司内部网站汇集到一个检索框中查找。 + +小结 +==== + +- Fess 是可以把文件服务器(SMB/CIFS、FTP、本地、S3、GCS)纳入全文检索对象的开源检索服务器 +- 通过 SMB 爬取的文件,其 ACL 中记录的访问权限会直接用于检索结果的区分展示,且该行为默认启用 +- 要实现继承权限的检索,与 Active Directory 或 LDAP 的对接是前提 +- 借助 Apache Tika,Office 文档和 PDF 的正文也会成为检索对象 +- 可以从小规模起步,随着对象增多再把 OpenSearch 扩展为集群 + +参考资料 +======== + +- `爬虫配置:Web、文件服务器、数据库爬取 `__ +- `基于角色的访问控制 `__ +- `搜索对象文件 `__ +- `快速构建指南 `__ +- `管理界面指南 `__ diff --git a/zh-cn/guide.rst b/zh-cn/guide.rst index 52fea39f4..9aa8ba41b 100644 --- a/zh-cn/guide.rst +++ b/zh-cn/guide.rst @@ -51,6 +51,7 @@ - :doc:`articles/use-cases` - 按行业和企业规模分类的用例 - :doc:`articles/comparison` - Fess与其他搜索解决方案的比较(Elasticsearch、Solr等) +- :doc:`articles/file-server-search` - 在文件服务器上引入全文检索前需要确认的要点 .. toctree:: :hidden: @@ -80,3 +81,4 @@ articles/guide-23 articles/use-cases articles/comparison + articles/file-server-search