mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 16:35:21 -04:00
Implement deep indexing for files through Xapian
ATM it support extracting metadata only from OGG files. The system has been designed to be easly extensible to more file formats registering more indexer functions which just need to extract metadata from a certain type of file and feed it to Xapian. The system has been integrated into existent file search system to through generric search requests and results, it keep a good level of retro-compatibility due to some tricks. The indexing system is released under AGPLv3 so when libretroshare is compiled with deep search enabled AGPLv3 must be honored instead of LGPLv3-or-later. Cleaned up the debian copyright file using non-deprecated license code-names.
This commit is contained in:
parent
d46e3eb2b7
commit
3a26ccf6a5
25 changed files with 1364 additions and 438 deletions
45
libretroshare/src/deep_search/commonutils.hpp
Normal file
45
libretroshare/src/deep_search/commonutils.hpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*******************************************************************************
|
||||
* RetroShare full text indexing and search implementation based on Xapian *
|
||||
* *
|
||||
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org> *
|
||||
* Copyright (C) 2019 Asociación Civil Altermundi <info@altermundi.net> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License version 3 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <xapian.h>
|
||||
#include <memory>
|
||||
|
||||
#include "util/rstime.h"
|
||||
|
||||
#ifndef XAPIAN_AT_LEAST
|
||||
#define XAPIAN_AT_LEAST(A,B,C) (XAPIAN_MAJOR_VERSION > (A) || \
|
||||
(XAPIAN_MAJOR_VERSION == (A) && \
|
||||
(XAPIAN_MINOR_VERSION > (B) || \
|
||||
(XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C)))))
|
||||
#endif // ndef XAPIAN_AT_LEAST
|
||||
|
||||
namespace DeepSearch
|
||||
{
|
||||
|
||||
std::unique_ptr<Xapian::WritableDatabase> openWritableDatabase(
|
||||
const std::string& path, int flags = 0, int blockSize = 0 );
|
||||
|
||||
std::unique_ptr<Xapian::Database> openReadOnlyDatabase(
|
||||
const std::string& path, int flags = 0 );
|
||||
|
||||
std::string timetToXapianDate(const rstime_t& time);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue