Skip to content

Commit d9c61d6

Browse files
docs: Add how to use the generated db
1 parent 59369ac commit d9c61d6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ DB->>CI: Bulk-transact all datoms
3232
CI->>RE: Zip and Publish
3333
```
3434

35+
# Using
36+
Go to this github [release page](https://github.com/clj-codes/docs.extractor/releases), download and unzip the `docs-db.zip` file.
37+
38+
## Connecting
39+
Since `v.0.2.0`, because of the new full-text index analyzers, this database requires this minimal connection opts to be used:
40+
```clojure
41+
(require '[datalevin.core :as d]
42+
'[datalevin.search-utils :as su])
43+
44+
(def conn-opts
45+
(let [query-analyzer (su/create-analyzer
46+
{:tokenizer (su/create-regexp-tokenizer #"[\s:/\.;,!=?\"'()\[\]{}|<>&@#^*\\~`\-]+")
47+
:token-filters [su/lower-case-token-filter]})]
48+
{:search-domains {"project-name" {:query-analyzer query-analyzer}
49+
"namespace-name" {:query-analyzer query-analyzer}
50+
"definition-name" {:query-analyzer query-analyzer}}}))
51+
52+
(d/get-conn "path/to/db" nil conn-opts)
53+
```
54+
3555
## Tools used
3656
- [tools.deps](https://github.com/clojure/tools.deps) Download projects/libraries
3757
- [clj-kondo](https://github.com/clj-kondo/clj-kondo) Parses/Analyses projects data

0 commit comments

Comments
 (0)