From 7ee76d74e4d37dd3419e6a04b874feef42a0a93c Mon Sep 17 00:00:00 2001 From: Lucas De Morais Date: Fri, 10 Nov 2023 16:56:06 +0100 Subject: [PATCH 1/4] perf: remove @orama/plugin-match-highlight in favor of @orama/highlight --- packages/docs/public/sitemap-0.xml | 92 +++++++++---------- packages/plugin-docusaurus/package.json | 6 +- .../src/client/theme/SearchBar/index.tsx | 75 +++++++-------- .../src/client/theme/SearchBar/style.css | 4 + .../src/client/theme/SearchResult/index.tsx | 40 +------- .../plugin-docusaurus/src/server/index.ts | 16 +--- .../plugin-docusaurus/src/server/types.ts | 2 +- .../plugin-docusaurus/test/integration.ts | 21 ++--- pnpm-lock.yaml | 45 +++++---- 9 files changed, 137 insertions(+), 164 deletions(-) diff --git a/packages/docs/public/sitemap-0.xml b/packages/docs/public/sitemap-0.xml index 2210ae019..7fb35cd38 100644 --- a/packages/docs/public/sitemap-0.xml +++ b/packages/docs/public/sitemap-0.xml @@ -1,49 +1,49 @@ -https://docs.oramasearch.com2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/csv-file2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/introduction2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/json-file2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/rest-api2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/webhooks2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/docusaurus2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/introduction2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/nextra2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/shopify2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/create-a-new-index2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/delete-an-index2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/edit-an-existing-index2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/integrating-orama-cloud/javascript-sdk2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/understanding-orama2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/cloud/understanding-orama/indexes2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/internals/components2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/internals/utilities2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-astro2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-data-persistence2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-docusaurus2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-match-highlight2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-nextra2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-parsedoc2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/text-analysis/stemming2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/text-analysis/stop-words2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/create2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/insert2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/remove2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/BM25-algorithm2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/facets2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/fields-boosting2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/filters2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/geosearch2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/grouping2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/introduction2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/preflight2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/sorting2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/threshold2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/vector-search2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/typescript2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/update2023-10-30T16:34:42.441Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/utilities2023-10-30T16:34:42.441Zdaily0.7 +https://docs.oramasearch.com2023-11-10T15:54:45.722Zdaily0.7 +https://docs.oramasearch.com/cloud2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/csv-file2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/introduction2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/json-file2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/rest-api2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/webhooks2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/docusaurus2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/introduction2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/nextra2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/shopify2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/create-a-new-index2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/delete-an-index2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/edit-an-existing-index2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/integrating-orama-cloud/javascript-sdk2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/understanding-orama2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/cloud/understanding-orama/indexes2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/internals/components2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/internals/utilities2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-astro2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-data-persistence2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-docusaurus2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-match-highlight2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-nextra2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-parsedoc2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/text-analysis/stemming2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/text-analysis/stop-words2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/create2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/insert2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/remove2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/BM25-algorithm2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/facets2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/fields-boosting2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/filters2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/geosearch2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/grouping2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/introduction2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/preflight2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/sorting2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/threshold2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/vector-search2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/typescript2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/update2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/utilities2023-11-10T15:54:45.723Zdaily0.7 \ No newline at end of file diff --git a/packages/plugin-docusaurus/package.json b/packages/plugin-docusaurus/package.json index 4b6d2b946..17df61a9e 100644 --- a/packages/plugin-docusaurus/package.json +++ b/packages/plugin-docusaurus/package.json @@ -48,9 +48,9 @@ "@algolia/autocomplete-js": "^1.7.2", "@algolia/autocomplete-theme-classic": "^1.7.3", "@docusaurus/theme-common": "^2.4.3", - "@orama/orama": "workspace:*", - "@orama/plugin-match-highlight": "workspace:*", - "@orama/plugin-parsedoc": "workspace:*", + "@orama/highlight": "^0.1.2", + "@orama/orama": "2.0.0-beta.4", + "@orama/plugin-parsedoc": "2.0.0-beta.4", "github-slugger": "^2.0.0", "pako": "^2.1.0", "vfile-message": "^3.1.3" diff --git a/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx b/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx index 25060a1dd..dc65c995d 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx +++ b/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx @@ -1,26 +1,25 @@ -import { autocomplete } from '@algolia/autocomplete-js' -import '@algolia/autocomplete-theme-classic/dist/theme.min.css' +import { autocomplete } from "@algolia/autocomplete-js" +import "@algolia/autocomplete-theme-classic/dist/theme.min.css" // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error // @ts-ignore Will fail in CJS compilation -import { GlobalVersion, useActiveVersion, useVersions } from '@docusaurus/plugin-content-docs/client' -import { useColorMode, useDocsPreferredVersion } from '@docusaurus/theme-common' -import useBaseUrl from '@docusaurus/useBaseUrl' -import useDocusaurusContext from '@docusaurus/useDocusaurusContext' -import { usePluginData } from '@docusaurus/useGlobalData' -import useIsBrowser from '@docusaurus/useIsBrowser' -import { create, load, AnyDocument } from '@orama/orama' -import type { OramaWithHighlight, Position } from '@orama/plugin-match-highlight' -import { searchWithHighlight } from '@orama/plugin-match-highlight' -import { ungzip } from 'pako' -import { Fragment, createElement, useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { render } from 'react-dom' +import { GlobalVersion, useActiveVersion, useVersions } from "@docusaurus/plugin-content-docs/client" +import { useColorMode, useDocsPreferredVersion } from "@docusaurus/theme-common" +import useBaseUrl from "@docusaurus/useBaseUrl" +import useDocusaurusContext from "@docusaurus/useDocusaurusContext" +import { usePluginData } from "@docusaurus/useGlobalData" +import useIsBrowser from "@docusaurus/useIsBrowser" +import { AnyDocument, create, load, Orama, RawData, search as oramaSearch } from "@orama/orama" +import { Highlight } from "@orama/highlight" +import { ungzip } from "pako" +import { createElement, Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { render } from "react-dom" // @ts-expect-error Resolve at runtime -import { SearchNoResults } from '@theme/SearchNoResults' +import { SearchNoResults } from "@theme/SearchNoResults" // @ts-expect-error Resolve at runtime -import { SearchResults } from '@theme/SearchResults' +import { SearchResults } from "@theme/SearchResults" // @ts-expect-error Resolve at runtime -import { SearchResult } from '@theme/SearchResult' -import { Hit, INDEX_FILE, PLUGIN_NAME, PluginData, RawDataWithPositions, schema } from '../../../server/types.js' +import { SearchResult } from "@theme/SearchResult" +import { Hit, INDEX_FILE, PLUGIN_NAME, PluginData, schema } from "../../../server/types.js" export default function SearchBar(): JSX.Element { const isBrowser = useIsBrowser() @@ -28,11 +27,12 @@ export default function SearchBar(): JSX.Element { const containerRef = useRef(null) const { colorMode } = useColorMode() const { searchData } = usePluginData(PLUGIN_NAME) as PluginData - const [database, setDatabase] = useState>() + const [database, setDatabase] = useState>() const searchBaseUrl = useBaseUrl(INDEX_FILE) const versions = useVersions(undefined) const activeVersion = useActiveVersion(undefined) const { preferredVersion } = useDocsPreferredVersion() + const highlighter = useMemo(() => new Highlight(), []) const version = useMemo(() => { if (!isBrowser) { @@ -79,21 +79,24 @@ export default function SearchBar(): JSX.Element { { sourceId: 'orama', async getItems() { - const results = await searchWithHighlight(database, { + if(!term) { + return [] + } + + const results = await oramaSearch(database, { term, properties: ['sectionTitle', 'sectionContent', 'type'] }) - const processed = results.hits.flatMap(hit => - Object.values((hit as any).positions.sectionContent).flatMap(positions => - (positions as any).map((position: Position) => ({ - ...hit, - position - })) - ) - ) - - return processed + return results.hits.flatMap((hit) => { + return { + ...hit, + document: { + ...hit.document, + sectionContent: highlighter.highlight(hit.document.sectionContent, term).trim(20), + } + } + }) }, getItemUrl({ item }: { item: Hit }) { return item.document.pageRoute @@ -130,7 +133,7 @@ export default function SearchBar(): JSX.Element { window.removeEventListener('keydown', handler) search.destroy() } - }, [isBrowser, siteConfig, database, colorMode, onKeyDown]) + }, [isBrowser, siteConfig, database, colorMode, onKeyDown, highlighter]) useEffect(() => { async function loadDatabase(version: GlobalVersion): Promise { @@ -151,13 +154,13 @@ export default function SearchBar(): JSX.Element { } const deflated = ungzip(buffer, { to: 'string' }) - const data: RawDataWithPositions = JSON.parse(deflated) + const data: RawData = JSON.parse(deflated) const _db = await create({ schema }) - const db = _db as OramaWithHighlight; - await load(db, data) - db.data.positions = data.positions - setDatabase(db) + + await load(_db, data) + + setDatabase(_db) } if (!isBrowser || !version) { diff --git a/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css b/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css index e536f6957..c654235cc 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css +++ b/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css @@ -71,3 +71,7 @@ font-size: 0.9em; color: var(--ifm-color-emphasis-600); } + +.aa-ItemLink { + margin-bottom: .6rem; +} diff --git a/packages/plugin-docusaurus/src/client/theme/SearchResult/index.tsx b/packages/plugin-docusaurus/src/client/theme/SearchResult/index.tsx index 32454c06c..127579c99 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchResult/index.tsx +++ b/packages/plugin-docusaurus/src/client/theme/SearchResult/index.tsx @@ -1,39 +1,8 @@ -import { Result } from '@orama/orama' -import { Position } from '@orama/plugin-match-highlight' -import { SectionSchema } from '../../../server/types.js' - -type Hit = Result & { position: Position } +import { Result } from "@orama/orama" +import { SectionSchema } from "../../../server/types.js" interface SearchResultProps { - hit: Hit -} - -function snippet(hit: Hit): JSX.Element { - const PADDING = 20 - const PADDING_MARKER = '...' - const isBeginning = hit.position.start < PADDING - const isEnd = hit.position.start + hit.position.length > (hit.document.sectionContent as string).length - PADDING - const preMatch = (hit.document.sectionContent as string).substring( - isBeginning ? 0 : hit.position.start - PADDING, - hit.position.start - ) - const match = (hit.document.sectionContent as string).substring( - hit.position.start, - hit.position.start + hit.position.length - ) - const postMatch = (hit.document.sectionContent as string).substring( - hit.position.start + hit.position.length, - hit.position.start + hit.position.length + PADDING - ) - return ( -

- {isBeginning ? '' : PADDING_MARKER} - {preMatch} - {match} - {postMatch} - {isEnd ? '' : PADDING_MARKER} -

- ) + hit: Result } export function SearchResult({ hit }: SearchResultProps): JSX.Element { @@ -44,7 +13,8 @@ export function SearchResult({ hit }: SearchResultProps): JSX.Element {
{hit.document.sectionTitle as string}
-
{snippet(hit)}
+
diff --git a/packages/plugin-docusaurus/src/server/index.ts b/packages/plugin-docusaurus/src/server/index.ts index 7efda1916..20c33bf19 100644 --- a/packages/plugin-docusaurus/src/server/index.ts +++ b/packages/plugin-docusaurus/src/server/index.ts @@ -1,7 +1,6 @@ import type { LoadedContent, LoadedVersion } from '@docusaurus/plugin-content-docs' import type { LoadContext, Plugin } from '@docusaurus/types' import { create, insertMultiple, save } from '@orama/orama' -import { OramaWithHighlight, afterInsert as highlightAfterInsert } from '@orama/plugin-match-highlight' import type { DefaultSchemaElement, NodeContent, PopulateFnContext } from '@orama/plugin-parsedoc' import { defaultHtmlSchema, populate } from '@orama/plugin-parsedoc' import * as githubSlugger from 'github-slugger' @@ -13,9 +12,9 @@ import { gzip as gzipCB } from 'node:zlib' import type { Configuration as WebpackConfiguration } from 'webpack' import { retrieveTranslationMessages } from './translationMessages.js' -import { INDEX_FILE, PLUGIN_NAME, PluginOptions, RawDataWithPositions, SectionSchema, schema } from './types.js' +import { INDEX_FILE, PLUGIN_NAME, PluginOptions, SectionSchema, schema } from './types.js' -export type { PluginData, PluginOptions, RawDataWithPositions, SectionSchema } from './types.js' +export type { PluginData, PluginOptions, SectionSchema } from './types.js' const gzip = promisify(gzipCB) @@ -146,17 +145,12 @@ async function buildDevSearchData(siteDir: string, outDir: string, allContent: a // Create the Orama database and then serialize it const _db = await create({ - schema, - components: { - afterInsert: [highlightAfterInsert] - } + schema }) - const db = _db as OramaWithHighlight - await insertMultiple(db, documents) + await insertMultiple(_db, documents) - const serialized = (await save(db)) as RawDataWithPositions - serialized.positions = db.data.positions + const serialized = (await save(_db)) await writeFile(indexPath(outDir, version), await gzip(JSON.stringify(serialized))) } diff --git a/packages/plugin-docusaurus/src/server/types.ts b/packages/plugin-docusaurus/src/server/types.ts index cf89302c3..48a7b5e5b 100644 --- a/packages/plugin-docusaurus/src/server/types.ts +++ b/packages/plugin-docusaurus/src/server/types.ts @@ -1,5 +1,5 @@ import { Result } from '@orama/orama' -import type { Position } from '@orama/plugin-match-highlight' +import type { Position } from '@orama/highlight' import type { AnyDocument, AnySchema, RawData } from '@orama/orama' diff --git a/packages/plugin-docusaurus/test/integration.ts b/packages/plugin-docusaurus/test/integration.ts index 5f5a88055..216eefe0a 100644 --- a/packages/plugin-docusaurus/test/integration.ts +++ b/packages/plugin-docusaurus/test/integration.ts @@ -1,5 +1,4 @@ -import { AnyOrama, TypedDocument, create, load } from '@orama/orama' -import { OramaWithHighlight, SearchResultWithHighlight, searchWithHighlight } from '@orama/plugin-match-highlight' +import { create, load, search } from "@orama/orama" import assert from 'node:assert' import { exec, ExecException } from 'node:child_process' import { existsSync } from 'node:fs' @@ -28,10 +27,6 @@ async function cleanup(): Promise { await rm(sandbox, { force: true, recursive: true }) } -function search>(database: OramaWithHighlight, term: string): Promise> { - return searchWithHighlight(database, { term, properties: ['sectionTitle', 'sectionContent', 'type'] }) -} - async function execute(command: string, cwd?: string): Promise { const { HOME, PATH } = process.env const env = cwd ? { HOME, PATH } : process.env @@ -94,31 +89,29 @@ await test('generated DBs have indexed pages content', async () => { const rawData = gunzipSync(rawCompressedData).toString('utf-8') const data = JSON.parse(rawData) - const _database = await create({ schema }) - const database = _database as OramaWithHighlight; + const database = await create({ schema }) await load(database, data) - database.data.positions = data.positions // Search results seem reasonable - const indexSearchResult = await search(database, 'index') + const indexSearchResult = await search(database, { term: 'index', properties: ['sectionTitle', 'sectionContent', 'type'] }) assert.ok(indexSearchResult.count === 1) assert.ok(indexSearchResult.hits[0].document.pageRoute === '/#main') - const catSearchResult = await search(database, 'cat') + const catSearchResult = await search(database, { term: 'cat', properties: ['sectionTitle', 'sectionContent', 'type'] }) assert.ok(catSearchResult.count === 1) assert.ok(catSearchResult.hits[0].document.pageRoute === '/animals_cat') - const dogSearchResult = await search(database, 'dog') + const dogSearchResult = await search(database, { term: 'dog', properties: ['sectionTitle', 'sectionContent', 'type'] }) assert.ok(dogSearchResult.count === 2) assert.ok(dogSearchResult.hits[0].document.pageRoute === '/animals_dog#dog') - const domesticSearchResult = await search(database, 'domestic') + const domesticSearchResult = await search(database, { term: 'domestic', properties: ['sectionTitle', 'sectionContent', 'type'] }) assert.ok(domesticSearchResult.count === 2) assert.ok(domesticSearchResult.hits[0].document.pageRoute === '/animals_cat') assert.ok(domesticSearchResult.hits[1].document.pageRoute === '/animals_dog#dog') // We do not have content about turtles - const turtleSearchResult = await search(database, 'turtle') + const turtleSearchResult = await search(database, { term: 'turtle', properties: ['sectionTitle', 'sectionContent', 'type'] }) assert.ok(turtleSearchResult.count === 0) }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d304f722..526e99a4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -68,7 +68,7 @@ importers: version: 3.17.0 tap: specifier: ^16.3.2 - version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) + version: 16.3.4(typescript@5.0.3) tap-mocha-reporter: specifier: ^5.0.3 version: 5.0.3 @@ -157,7 +157,7 @@ importers: version: 8.4.31 tailwindcss: specifier: ^3.3.3 - version: 3.3.3(ts-node@10.9.1) + version: 3.3.3 packages/orama: devDependencies: @@ -205,7 +205,7 @@ importers: version: 2.8.1 tap: specifier: ^16.3.2 - version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) + version: 16.3.4(typescript@5.0.3) tap-mocha-reporter: specifier: ^5.0.3 version: 5.0.3 @@ -303,7 +303,7 @@ importers: version: 4.3.0 tap: specifier: ^16.3.0 - version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) + version: 16.3.4(typescript@5.0.3) tap-mocha-reporter: specifier: ^5.0.3 version: 5.0.3 @@ -325,14 +325,14 @@ importers: '@docusaurus/theme-common': specifier: ^2.4.3 version: 2.4.3(@docusaurus/types@2.4.3)(@swc/core@1.3.27)(eslint@8.48.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.0.3) + '@orama/highlight': + specifier: ^0.1.2 + version: 0.1.2 '@orama/orama': - specifier: workspace:* + specifier: 2.0.0-beta.4 version: link:../orama - '@orama/plugin-match-highlight': - specifier: workspace:* - version: link:../plugin-match-highlight '@orama/plugin-parsedoc': - specifier: workspace:* + specifier: 2.0.0-beta.4 version: link:../plugin-parsedoc github-slugger: specifier: ^2.0.0 @@ -458,7 +458,7 @@ importers: version: 7.12.0 tap: specifier: ^16.3.4 - version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) + version: 16.3.4(typescript@5.0.3) tsx: specifier: ^3.12.2 version: 3.12.2 @@ -562,7 +562,7 @@ importers: version: 7.12.0 tap: specifier: ^16.3.4 - version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) + version: 16.3.4(typescript@5.0.3) tsx: specifier: ^3.12.2 version: 3.12.2 @@ -3923,6 +3923,17 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + /@orama/highlight@0.1.2: + resolution: {integrity: sha512-B48PnxFwRRHBeEIkmKI38tZmpQDWdt6o4bch5dZaChdZh0pwPHtostMv++eVlNv3/qLtfcdLoSYHWvoN9Mp0Lw==} + dependencies: + '@orama/orama': 2.0.0-beta.4 + dev: false + + /@orama/orama@2.0.0-beta.4: + resolution: {integrity: sha512-hPg18sBo8YtZ1vebGwKKcvsLr3EVNR7FoqfDnj7BgGdO5eKsEDINjTGaQIJpAQRNqmSZnGW5N+soXa3Br6GkEA==} + engines: {node: '>= 16.0.0'} + dev: false + /@pkgr/utils@2.4.1: resolution: {integrity: sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -13148,7 +13159,7 @@ packages: postcss: 8.4.31 dev: true - /postcss-load-config@4.0.1(postcss@8.4.31)(ts-node@10.9.1): + /postcss-load-config@4.0.1(postcss@8.4.31): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} peerDependencies: @@ -13162,7 +13173,6 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.31 - ts-node: 10.9.1(@swc/core@1.3.27)(@types/node@18.11.18)(typescript@5.0.3) yaml: 2.3.1 dev: true @@ -15636,7 +15646,7 @@ packages: strip-ansi: 6.0.1 dev: true - /tailwindcss@3.3.3(ts-node@10.9.1): + /tailwindcss@3.3.3: resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} engines: {node: '>=14.0.0'} hasBin: true @@ -15658,7 +15668,7 @@ packages: postcss: 8.4.31 postcss-import: 15.1.0(postcss@8.4.31) postcss-js: 4.0.1(postcss@8.4.31) - postcss-load-config: 4.0.1(postcss@8.4.31)(ts-node@10.9.1) + postcss-load-config: 4.0.1(postcss@8.4.31) postcss-nested: 6.0.1(postcss@8.4.31) postcss-selector-parser: 6.0.13 resolve: 1.22.2 @@ -15700,7 +15710,7 @@ packages: yaml: 1.10.2 dev: true - /tap@16.3.4(ts-node@10.9.1)(typescript@5.0.3): + /tap@16.3.4(typescript@5.0.3): resolution: {integrity: sha512-SAexdt2ZF4XBgye6TPucFI2y7VE0qeFXlXucJIV1XDPCs+iJodk0MYacr1zR6Ycltzz7PYg8zrblDXKbAZM2LQ==} engines: {node: '>=12'} hasBin: true @@ -15739,7 +15749,6 @@ packages: tap-parser: 11.0.2 tap-yaml: 1.0.2 tcompare: 5.0.7 - ts-node: 10.9.1(@swc/core@1.3.27)(@types/node@18.11.18)(typescript@5.0.3) typescript: 5.0.3 which: 2.0.2 transitivePeerDependencies: From da7d9bd57ba6041c9813a635f5bba679dafb1a5c Mon Sep 17 00:00:00 2001 From: Michele Riva Date: Fri, 10 Nov 2023 19:14:29 +0100 Subject: [PATCH 2/4] updates css styles --- packages/docs/public/sitemap-0.xml | 93 ++++++++++--------- .../src/client/theme/SearchBar/index.tsx | 8 +- .../src/client/theme/SearchBar/style.css | 8 ++ .../client/theme/SearchBarFooter/index.tsx | 2 +- .../client/theme/SearchBarFooter/style.css | 2 +- 5 files changed, 63 insertions(+), 50 deletions(-) diff --git a/packages/docs/public/sitemap-0.xml b/packages/docs/public/sitemap-0.xml index 7fb35cd38..b54e9c0d3 100644 --- a/packages/docs/public/sitemap-0.xml +++ b/packages/docs/public/sitemap-0.xml @@ -1,49 +1,50 @@ -https://docs.oramasearch.com2023-11-10T15:54:45.722Zdaily0.7 -https://docs.oramasearch.com/cloud2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/csv-file2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/introduction2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/json-file2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/rest-api2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/webhooks2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/docusaurus2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/introduction2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/nextra2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/shopify2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/create-a-new-index2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/delete-an-index2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/edit-an-existing-index2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/integrating-orama-cloud/javascript-sdk2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/understanding-orama2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/cloud/understanding-orama/indexes2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/internals/components2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/internals/utilities2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-astro2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-data-persistence2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-docusaurus2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-match-highlight2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-nextra2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-parsedoc2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/text-analysis/stemming2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/text-analysis/stop-words2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/create2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/insert2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/remove2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/BM25-algorithm2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/facets2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/fields-boosting2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/filters2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/geosearch2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/grouping2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/introduction2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/preflight2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/sorting2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/threshold2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/vector-search2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/typescript2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/update2023-11-10T15:54:45.723Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/utilities2023-11-10T15:54:45.723Zdaily0.7 +https://docs.oramasearch.com2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/csv-file2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/introduction2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/json-file2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/rest-api2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/webhooks2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/docusaurus2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/introduction2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/nextra2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/shopify2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/create-a-new-index2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/delete-an-index2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/edit-an-existing-index2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/integrating-orama-cloud/javascript-sdk2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/understanding-orama2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/cloud/understanding-orama/indexes2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/internals/components2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/internals/utilities2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-astro2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-data-persistence2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-docusaurus2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-match-highlight2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-nextra2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-parsedoc2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/writing-your-own-plugins2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/text-analysis/stemming2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/text-analysis/stop-words2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/create2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/insert2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/remove2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/BM25-algorithm2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/facets2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/fields-boosting2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/filters2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/geosearch2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/grouping2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/introduction2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/preflight2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/sorting2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/threshold2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/vector-search2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/typescript2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/update2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/utilities2023-11-10T17:44:31.199Zdaily0.7 \ No newline at end of file diff --git a/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx b/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx index dc65c995d..bf6795ace 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx +++ b/packages/plugin-docusaurus/src/client/theme/SearchBar/index.tsx @@ -21,6 +21,11 @@ import { SearchResults } from "@theme/SearchResults" import { SearchResult } from "@theme/SearchResult" import { Hit, INDEX_FILE, PLUGIN_NAME, PluginData, schema } from "../../../server/types.js" +const highlighter = new Highlight({ + CSSClass: 'aa-ItemContentHighlight', + HTMLTag: 'span', +}) + export default function SearchBar(): JSX.Element { const isBrowser = useIsBrowser() const { siteConfig } = useDocusaurusContext() @@ -32,7 +37,6 @@ export default function SearchBar(): JSX.Element { const versions = useVersions(undefined) const activeVersion = useActiveVersion(undefined) const { preferredVersion } = useDocsPreferredVersion() - const highlighter = useMemo(() => new Highlight(), []) const version = useMemo(() => { if (!isBrowser) { @@ -133,7 +137,7 @@ export default function SearchBar(): JSX.Element { window.removeEventListener('keydown', handler) search.destroy() } - }, [isBrowser, siteConfig, database, colorMode, onKeyDown, highlighter]) + }, [isBrowser, siteConfig, database, colorMode, onKeyDown]) useEffect(() => { async function loadDatabase(version: GlobalVersion): Promise { diff --git a/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css b/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css index c654235cc..64b54d8df 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css +++ b/packages/plugin-docusaurus/src/client/theme/SearchBar/style.css @@ -74,4 +74,12 @@ .aa-ItemLink { margin-bottom: .6rem; + text-decoration: none !important; + color: rgba(var(--aa-primary-color-rgb), 1) !important; + padding: calc(var(--aa-spacing-half)/1.2); } + +.aa-ItemContentHighlight { + color: rgba(var(--aa-primary-color-rgb), 1); + font-weight: bold; +} \ No newline at end of file diff --git a/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/index.tsx b/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/index.tsx index 93ec90041..4ffdd8cbe 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/index.tsx +++ b/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/index.tsx @@ -42,7 +42,7 @@ export function SearchBarFooter({ translations = {} }: SearchBarFooterProps): JS navigateDownKeyAriaLabel = 'Arrow down', closeText = 'to close', closeKeyAriaLabel = 'Escape key', - searchByText = 'Search by' + searchByText = 'Powered by' } = translations const { colorMode } = useColorMode() diff --git a/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/style.css b/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/style.css index fdf5945d1..f0509f62d 100644 --- a/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/style.css +++ b/packages/plugin-docusaurus/src/client/theme/SearchBarFooter/style.css @@ -72,5 +72,5 @@ a.aa-FooterSearchCredit span { } a.aa-FooterSearchCredit svg { - min-width: 8em; + min-width: 7em; } From f78fffd110bcf1fd7ad81a5b073ff5ed78cbd943 Mon Sep 17 00:00:00 2001 From: Michele Riva Date: Fri, 10 Nov 2023 19:33:07 +0100 Subject: [PATCH 3/4] fixes package.json --- packages/plugin-docusaurus/package.json | 4 ++-- pnpm-lock.yaml | 28 +++++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/plugin-docusaurus/package.json b/packages/plugin-docusaurus/package.json index 5a984b813..474f8680c 100644 --- a/packages/plugin-docusaurus/package.json +++ b/packages/plugin-docusaurus/package.json @@ -49,8 +49,8 @@ "@algolia/autocomplete-theme-classic": "^1.7.3", "@docusaurus/theme-common": "^2.4.3", "@orama/highlight": "^0.1.2", - "@orama/orama": "2.0.0-beta.4", - "@orama/plugin-parsedoc": "2.0.0-beta.4", + "@orama/orama": "workspace:*", + "@orama/plugin-parsedoc": "workspace:*", "github-slugger": "^2.0.0", "pako": "^2.1.0", "vfile-message": "^3.1.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66fc064aa..f3df32760 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' settings: autoInstallPeers: true @@ -68,7 +68,7 @@ importers: version: 3.17.0 tap: specifier: ^16.3.2 - version: 16.3.4(typescript@5.0.3) + version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) tap-mocha-reporter: specifier: ^5.0.3 version: 5.0.3 @@ -157,7 +157,7 @@ importers: version: 8.4.31 tailwindcss: specifier: ^3.3.3 - version: 3.3.3 + version: 3.3.3(ts-node@10.9.1) packages/orama: devDependencies: @@ -205,7 +205,7 @@ importers: version: 2.8.1 tap: specifier: ^16.3.2 - version: 16.3.4(typescript@5.0.3) + version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) tap-mocha-reporter: specifier: ^5.0.3 version: 5.0.3 @@ -303,7 +303,7 @@ importers: version: 4.3.0 tap: specifier: ^16.3.0 - version: 16.3.4(typescript@5.0.3) + version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) tap-mocha-reporter: specifier: ^5.0.3 version: 5.0.3 @@ -329,10 +329,10 @@ importers: specifier: ^0.1.2 version: 0.1.2 '@orama/orama': - specifier: 2.0.0-beta.4 + specifier: workspace:* version: link:../orama '@orama/plugin-parsedoc': - specifier: 2.0.0-beta.4 + specifier: workspace:* version: link:../plugin-parsedoc github-slugger: specifier: ^2.0.0 @@ -458,7 +458,7 @@ importers: version: 7.12.0 tap: specifier: ^16.3.4 - version: 16.3.4(typescript@5.0.3) + version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) tsx: specifier: ^3.12.2 version: 3.12.2 @@ -562,7 +562,7 @@ importers: version: 7.12.0 tap: specifier: ^16.3.4 - version: 16.3.4(typescript@5.0.3) + version: 16.3.4(ts-node@10.9.1)(typescript@5.0.3) tsx: specifier: ^3.12.2 version: 3.12.2 @@ -13160,7 +13160,7 @@ packages: postcss: 8.4.31 dev: true - /postcss-load-config@4.0.1(postcss@8.4.31): + /postcss-load-config@4.0.1(postcss@8.4.31)(ts-node@10.9.1): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} peerDependencies: @@ -13174,6 +13174,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.31 + ts-node: 10.9.1(@swc/core@1.3.27)(@types/node@18.11.18)(typescript@5.0.3) yaml: 2.3.1 dev: true @@ -15647,7 +15648,7 @@ packages: strip-ansi: 6.0.1 dev: true - /tailwindcss@3.3.3: + /tailwindcss@3.3.3(ts-node@10.9.1): resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} engines: {node: '>=14.0.0'} hasBin: true @@ -15669,7 +15670,7 @@ packages: postcss: 8.4.31 postcss-import: 15.1.0(postcss@8.4.31) postcss-js: 4.0.1(postcss@8.4.31) - postcss-load-config: 4.0.1(postcss@8.4.31) + postcss-load-config: 4.0.1(postcss@8.4.31)(ts-node@10.9.1) postcss-nested: 6.0.1(postcss@8.4.31) postcss-selector-parser: 6.0.13 resolve: 1.22.2 @@ -15711,7 +15712,7 @@ packages: yaml: 1.10.2 dev: true - /tap@16.3.4(typescript@5.0.3): + /tap@16.3.4(ts-node@10.9.1)(typescript@5.0.3): resolution: {integrity: sha512-SAexdt2ZF4XBgye6TPucFI2y7VE0qeFXlXucJIV1XDPCs+iJodk0MYacr1zR6Ycltzz7PYg8zrblDXKbAZM2LQ==} engines: {node: '>=12'} hasBin: true @@ -15750,6 +15751,7 @@ packages: tap-parser: 11.0.2 tap-yaml: 1.0.2 tcompare: 5.0.7 + ts-node: 10.9.1(@swc/core@1.3.27)(@types/node@18.11.18)(typescript@5.0.3) typescript: 5.0.3 which: 2.0.2 transitivePeerDependencies: From fc2cd0cd6a8503d6cdf17aaa7417e9c9560d807d Mon Sep 17 00:00:00 2001 From: Michele Riva Date: Fri, 10 Nov 2023 19:45:50 +0100 Subject: [PATCH 4/4] updates sitemap --- packages/docs/public/sitemap-0.xml | 94 +++++++++++++++--------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/packages/docs/public/sitemap-0.xml b/packages/docs/public/sitemap-0.xml index b54e9c0d3..6a4c69fab 100644 --- a/packages/docs/public/sitemap-0.xml +++ b/packages/docs/public/sitemap-0.xml @@ -1,50 +1,50 @@ -https://docs.oramasearch.com2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/csv-file2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/introduction2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/json-file2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/rest-api2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/custom/webhooks2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/docusaurus2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/introduction2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/nextra2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/data-sources/native-integrations/shopify2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/create-a-new-index2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/delete-an-index2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/indexes/edit-an-existing-index2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/integrating-orama-cloud/javascript-sdk2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/understanding-orama2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/cloud/understanding-orama/indexes2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/internals/components2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/internals/utilities2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-astro2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-data-persistence2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-docusaurus2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-match-highlight2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-nextra2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/plugin-parsedoc2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/plugins/writing-your-own-plugins2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/text-analysis/stemming2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/text-analysis/stop-words2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/create2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/insert2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/remove2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/BM25-algorithm2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/facets2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/fields-boosting2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/filters2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/geosearch2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/grouping2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/introduction2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/preflight2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/sorting2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/threshold2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/search/vector-search2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/typescript2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/update2023-11-10T17:44:31.199Zdaily0.7 -https://docs.oramasearch.com/open-source/usage/utilities2023-11-10T17:44:31.199Zdaily0.7 +https://docs.oramasearch.com2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/csv-file2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/introduction2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/json-file2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/rest-api2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/custom/webhooks2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/docusaurus2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/introduction2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/nextra2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/data-sources/native-integrations/shopify2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/create-a-new-index2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/delete-an-index2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/indexes/edit-an-existing-index2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/integrating-orama-cloud/javascript-sdk2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/understanding-orama2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/cloud/understanding-orama/indexes2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/internals/components2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/internals/utilities2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-astro2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-data-persistence2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-docusaurus2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-match-highlight2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-nextra2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/plugin-parsedoc2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/plugins/writing-your-own-plugins2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/text-analysis/stemming2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/text-analysis/stop-words2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/create2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/insert2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/remove2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/BM25-algorithm2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/facets2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/fields-boosting2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/filters2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/geosearch2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/grouping2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/introduction2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/preflight2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/sorting2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/threshold2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/search/vector-search2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/typescript2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/update2023-11-10T18:43:38.763Zdaily0.7 +https://docs.oramasearch.com/open-source/usage/utilities2023-11-10T18:43:38.763Zdaily0.7 \ No newline at end of file