plugin-search-backend-module-pg

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-19 12:31:26 +02:00
parent 3ec16d2c41
commit 6a001acf8c
8 changed files with 27 additions and 18 deletions
+10 -16
View File
@@ -18,8 +18,6 @@ export type ConcretePgSearchQuery = {
pageSize: number;
};
// Warning: (ae-missing-release-tag) "DatabaseDocumentStore" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class DatabaseDocumentStore implements DatabaseStore {
constructor(db: Knex);
@@ -39,8 +37,6 @@ export class DatabaseDocumentStore implements DatabaseStore {
): Promise<void>;
// (undocumented)
prepareInsert(tx: Knex.Transaction): Promise<void>;
// Warning: (ae-forgotten-export) The symbol "DocumentResultRow" needs to be exported by the entry point index.d.ts
//
// (undocumented)
query(
tx: Knex.Transaction,
@@ -52,8 +48,6 @@ export class DatabaseDocumentStore implements DatabaseStore {
transaction<T>(fn: (tx: Knex.Transaction) => Promise<T>): Promise<T>;
}
// Warning: (ae-missing-release-tag) "DatabaseStore" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface DatabaseStore {
// (undocumented)
@@ -77,8 +71,16 @@ export interface DatabaseStore {
transaction<T>(fn: (tx: Knex.Transaction) => Promise<T>): Promise<T>;
}
// Warning: (ae-missing-release-tag) "PgSearchEngine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface DocumentResultRow {
// (undocumented)
document: IndexableDocument;
// (undocumented)
highlight: IndexableDocument;
// (undocumented)
type: string;
}
// @public (undocumented)
export class PgSearchEngine implements SearchEngine {
// @deprecated
@@ -108,8 +110,6 @@ export class PgSearchEngine implements SearchEngine {
): ConcretePgSearchQuery;
}
// Warning: (ae-missing-release-tag) "PgSearchEngineIndexer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class PgSearchEngineIndexer extends BatchSearchEngineIndexer {
constructor(options: PgSearchEngineIndexerOptions);
@@ -121,8 +121,6 @@ export class PgSearchEngineIndexer extends BatchSearchEngineIndexer {
initialize(): Promise<void>;
}
// Warning: (ae-missing-release-tag) "PgSearchEngineIndexerOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type PgSearchEngineIndexerOptions = {
batchSize: number;
@@ -148,8 +146,6 @@ export type PgSearchOptions = {
database: PluginDatabaseManager;
};
// Warning: (ae-missing-release-tag) "PgSearchQuery" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface PgSearchQuery {
// (undocumented)
@@ -177,8 +173,6 @@ export type PgSearchQueryTranslatorOptions = {
highlightOptions: PgSearchHighlightOptions;
};
// Warning: (ae-missing-release-tag) "RawDocumentRow" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface RawDocumentRow {
// (undocumented)
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PluginDatabaseManager } from '@backstage/backend-common';
import { SearchEngine } from '@backstage/plugin-search-common';
import {
@@ -79,6 +80,7 @@ export type PgSearchHighlightOptions = {
postTag: string;
};
/** @public */
export class PgSearchEngine implements SearchEngine {
private readonly highlightOptions: PgSearchHighlightOptions;
@@ -19,12 +19,14 @@ import { IndexableDocument } from '@backstage/plugin-search-common';
import { Knex } from 'knex';
import { DatabaseStore } from '../database';
/** @public */
export type PgSearchEngineIndexerOptions = {
batchSize: number;
type: string;
databaseStore: DatabaseStore;
};
/** @public */
export class PgSearchEngineIndexer extends BatchSearchEngineIndexer {
private store: DatabaseStore;
private type: string;
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { PgSearchEngine } from './PgSearchEngine';
export type {
ConcretePgSearchQuery,
@@ -32,6 +32,7 @@ const migrationsDir = resolvePackagePath(
'migrations',
);
/** @public */
export class DatabaseDocumentStore implements DatabaseStore {
static async create(
database: PluginDatabaseManager,
@@ -13,5 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { DatabaseDocumentStore } from './DatabaseDocumentStore';
export type { DatabaseStore, PgSearchQuery, RawDocumentRow } from './types';
export type {
DatabaseStore,
DocumentResultRow,
PgSearchQuery,
RawDocumentRow,
} from './types';
@@ -17,6 +17,7 @@ import { IndexableDocument } from '@backstage/plugin-search-common';
import { Knex } from 'knex';
import { PgSearchHighlightOptions } from '../PgSearchEngine';
/** @public */
export interface PgSearchQuery {
fields?: Record<string, string | string[]>;
types?: string[];
@@ -26,6 +27,7 @@ export interface PgSearchQuery {
options: PgSearchHighlightOptions;
}
/** @public */
export interface DatabaseStore {
transaction<T>(fn: (tx: Knex.Transaction) => Promise<T>): Promise<T>;
getTransaction(): Promise<Knex.Transaction>;
@@ -42,12 +44,14 @@ export interface DatabaseStore {
): Promise<DocumentResultRow[]>;
}
/** @public */
export interface RawDocumentRow {
document: IndexableDocument;
type: string;
hash: unknown;
}
/** @public */
export interface DocumentResultRow {
document: IndexableDocument;
type: string;
-1
View File
@@ -230,7 +230,6 @@ const ALLOW_WARNINGS = [
'plugins/newrelic',
'plugins/newrelic-dashboard',
'plugins/pagerduty',
'plugins/search-backend-module-pg',
];
async function resolvePackagePath(