zoukankan      html  css  js  c++  java
  • typesense/docsearchscraper 使用记录

    概括:

    1、使用 typesense/docsearch-scraper 抓取网站内容,制作索引
    2、网站中添加 UI 组件,在搜索时请求制作的数据索引
    3、定时抓取网站内容,更新索引

    过程:

    1、安装并运行 Typesense

    docker pull typesense/typesense:0.22.1
    export TYPESENSE_API_KEY=xyz
    mkdir /tmp/typesense-data
    docker run -p 8108:8108 -d -v/tmp/typesense-data:/data typesense/typesense:0.22.1 --data-dir /data --api-key=$TYPESENSE_API_KEY
    

    Typesense 健康检查

    curl http://localhost:8108/health

    2、安装 jq

    https://stedolan.github.io/jq/download/

    centos:yum install jq

    3、typesense - .env

    vim /path/typesense/.env

    TYPESENSE_API_KEY=xyz
    TYPESENSE_HOST=xxx.a1.typesense.net
    TYPESENSE_PORT=443
    TYPESENSE_PROTOCOL=https
    

    4、typesense - config.json

    vim /path/typesense/config.json

    config.json 内容格式参考【 https://github.com/algolia/docsearch-configs

    5、安装并运行 typesense/docsearch-scraper

    docker run -d --env-file=/path/typesense/.env -e "CONFIG=$(cat /path/typesense/config.json | jq -r tostring)" typesense/docsearch-scraper

    let the world have no hard-to-write code ^-^
  • 相关阅读:
    数据库相关
    linux相关
    类相关
    异常处理
    一些类的概念
    安装插件
    接口开发
    redis相关
    大数据-概览
    大数据-浅谈OLTP与OLAP
  • 原文地址:https://www.cnblogs.com/ovim/p/15680843.html
Copyright © 2011-2022 走看看