[Unlocked] Bonus Drop #22.1 (2023-08-20): Quick…wit

Releasing a Bonus Drop instead of a new WPE as a bout of paronychia in my left 👍🏽 has made typing and cogitating nigh impossible.

Honestly, getting the more polished cousin of the server used in the original Bonus Drop to work isn’t “hard”. So, I made a branch (link below) of the source repo that swaps out the kind of more janky server for the more pro one.

Quickwit 0.6

Repo: https://gitlab.com/hrbrmstr/podsrch/-/tree/quickwit

One nice thing (of many nice things) about Quickwit is that it has CORS support.

Follow the quick start on their site to get it installed. They did a great job and you’ll have it running in a couple minutes

Add:

rest_cors_allow_origins: '*'

to quickwit.yaml and restart the server.

This is the (ugh) YAML config for the podcast I used:

version: 0.6
index_id: knowledgefight

doc_mapping:
  store_source: false
  field_mappings:
    - name: show
      type: text
      fast: false
    - name: id
      type: text
      fast: false
    - name: from
      type: text
      fast: false
    - name: episode
      type: text
      fast: false
    - name: to
      type: text
      fast: false
    - name: link
      type: text
      fast: false
    - name: pubDate
      type: datetime
      fast: true
    - name: duration
      type: text
      fast: false
    - name: title
      type: text
      tokenizer: default
      record: position
    - name: text
      type: text
      tokenizer: en_stem
      record: position
    - name: description
      type: text
      tokenizer: en_stem
      record: position

search_settings:
  default_search_fields: [text, description]

In the Quickwit Search endpoint REST API there’s a snippet_fields parameter that controls which fields are returned in search result snippets. They’re a top-level field in the return value:

This means you could modify the app to show the highlighted portion.

Do a source diff, and you’ll see that the changes were super tiny, including the addition of how fast the search was.

FIN

Hope the remaining bits of your weekend are stellar! ☮

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.