官方文档地址:https://swiftype.com/documentation/app-search/getting-started

Elastic App Search 架构图:

它的特点是帮助开发者随心所欲的为已有的或者正在开发的项目增加功能强大的搜索功能,而且将搜索功能的实施成本降低到无痛点的程度。App Search 可以覆盖的使用场景如下:

SaaS / web 应用

复杂的电商应用

客户支持服务站点

Geo 地理搜索

公司官网

内部的搜索

还有更多其他

1.安装好elasticsearch和kibana,不使用https,不开启安全,不设置账号密码等,分别启动等

2.配置java环境,详看这篇文章:https://www.cnblogs.com/sanduzxcvbnm/p/12522735.html

3.在Elasticsearch的安装根目录中打开文件config/elasticsearch.yml文件,并添加如下的配置:

action.auto_create_index: ".app-search-*-logs-*,-.app-search-*,+*"

等修改完后,重新启动Elasticsearch

4.打开App search安装目录下的confing/app-search.yml文件,做如下的配置:

allow_es_settings_modification: true
elasticsearch.host: http://192.168.80.10:9200 # 连接es的地址,根据实际情况而定 # Define the exposed URL at which users will reach App Search.定义用户访问应用程序搜索的公开URL
app_search.external_url: http://192.168.80.10:3002 # Web application listen_host and listen_port.Web应用程序侦听主机和侦听端口
app_search.listen_host: 192.168.80.10
app_search.listen_port: 3002
# app_search连接es的话配置的es的有账号和密码,则在初始化app_search的时候会自动给app_search创建账号密码

启动app_search,信息如下:

5.打开浏览器,输入地址http://192.168.80.10:3002,出现的界面如下:

到此为止,App Search 服务器的安装就完成了。它其实是一个基于 Elasticsearch 的搜索服务平台。

点击上面的Continue to Dashboard按钮:

点击右上角的Skip跳过的话则会进入这个界面:

查看kibana索引管理信息,会看到有好多.app-search的系统索引

6.导入json文件

点击左上角的"Engines",然后再点击右上角的"Create an Engines",输入Engines名称,然后点击"Create Engines"

进入到如下界面:



有三种导入数据的方式:

第一种:选择"Paste JSON",粘贴json数据,然后导入

第二种:选择"Upload a JSON File",选择一个json文件,然后导入

第三种:使用API接口导入文件

我这边采用第二种方式:



7.修改索引的schema

这是因为在默认的情况下,所有的11个字段都被视为text类型。

在完成我们的修改过后,点击Update Types按钮。这样我们的索引将会被重新更新。

8.调节相关度

具有三个关键的相关功能:Synonyms(同义词),Curations(管理)和Relevance Tuning(相关度调整)。

8.1 Synonyms

单击进入同义词,然后选择创建同义词集并输入术语:



现在,搜索FF与搜索Final Fantasy的权重相同。

8.2 Curations

单击“Curations”,然后输入查询:“Final Fantasy”。

接下来,通过抓住表格最左侧的把手将“Final FantasyVII”文档拖到“Promoted Documents”部分:



然后单击“Final Fantasy XIII”文档上的“Hide Result”按钮(那个有一条线穿过眼睛的图标,下图列表中第三个图标):



现在,执行“Final Fantasy”或“FF”搜索的任何人都将首先看到“Final Fantasy VII”:

可以升级和隐藏许多文档。 我们甚至可以对升级后的文档进行排序,因此我们可以完全控制每个查询顶部显示的内容。

8.3 Relevance tuning

单击边栏中的“Relevance Tuning”,可以选择一个字段,可以增加其相关性的权重,在右侧可以实时查看调整权重后搜索文档的排名效果



将滑块拖动到更高的值,然后单击“Save”。

9.Reference UI

Reference UI 是提供给用户使用的搜索界面,它可以是只有一个输入框,也可以是比较复杂的条件查询

点击Reference UI,并做相应的配置。点击Generate a Preview按钮:



这样我们就可以看到如上所示的用户界面。我们可以尝试输入一个关键字比如 final fantasy来进行搜索:



马上看到我们想要的结果了。

还可以点击上面显示的filter及sort by,作进一步操作

没有做任何的开发就有一个非常酷的界面给我们进行搜索了。

10.导出

点击上面屏幕右上角的Download Zip Package,并保存于一个文件目录中



解压这个压缩包:



可以看到这是一个nodejs的应用程序。使用如下的命令来进行安装,本机先安装nodejs:

npm install

一旦安装完后,我们可以使用如下的命令来进行运行:

npm start

可以看到和之前一样的界面。

部署到nginx项目中:

然后运行 npm run build 命令,会把nodejs应用打包到一个名为bulid的文件夹中,

npm run build

最后把bulid的文件夹中的所有内容移动到nginx的html目录下,启动nginx,就能使再次使用浏览器访问了。

mv -f build/* /usr/share/nginx/html

app-search的安全设置链接

https://swiftype.com/documentation/app-search/self-managed/security

Default Configuration File

## ===================== Elastic App Search Configuration =====================
#
# NOTE: Elastic App Search comes with reasonable defaults.
# Before adjusting the configuration, make sure you understand what you
# are trying to accomplish and the consequences.
#
# NOTE: For passwords, the use of environment variables is encouraged
# to keep values from being written to disk, e.g.
# elasticsearch.password: ${ELASTICSEARCH_PASSWORD:changeme}
#
# ------------------------------- Elasticsearch -------------------------------
#
# App Search needs one-time permission to alter Elasticsearch settings.
# Ensure the Elasticsearch settings are correct, then set the following to
# true.
# Or, adjust Elasticsearch's config/elasticsearch.yml instead.
# See README.md for more details.
#
#allow_es_settings_modification: false
#
# Elasticsearch full cluster URL:
#
#elasticsearch.host: http://127.0.0.1:9200
#
# Elasticsearch credentials:
#
#elasticsearch.username: elastic
#elasticsearch.password: changeme
#
# Elasticsearch custom HTTP headers to add to each request:
#
#elasticsearch.headers:
# X-My-Header: Contents of the header
#
# Elasticsearch SSL settings:
#
#elasticsearch.ssl.enabled: false
#elasticsearch.ssl.certificate:
#elasticsearch.ssl.certificate_authority:
#elasticsearch.ssl.key:
#elasticsearch.ssl.key_passphrase:
#elasticsearch.ssl.verify: true
#
# ------------------------------- Hosting & Network ---------------------------
#
# Define the exposed URL at which users will reach App Search.
# Defaults to localhost:3002 for testing purposes.
# Most cases will use one of:
#
# * An IP: http://255.255.255.255
# * A FQDN: http://example.com
# * Shortname defined via /etc/hosts: http://app-search.search
#
#app_search.external_url: http://localhost:3002
#
# Web application listen_host and listen_port.
# Your application will run on this host and port.
#
# * app_search.listen_host: Must be a valid IPv4 or IPv6 address.
# * app_search.listen_port: Must be a valid port number (1-65535).
#
#app_search.listen_host: 127.0.0.1
#app_search.listen_port: 3002
#
# ------------------------------ Authentication -------------------------------
#
# The origin of authenticated App Search users.
# Options are standard, elasticsearch-native, and elasticsearch-saml.
#
# Docs: https://swiftype.com/documentation/app-search/self-managed/security
#
# * standard: Users are created within the App Search dashboard.
# * elasticsearch-native: Users are managed via the Elasticsearch native realm.
# * elasticsearch-saml: Users are managed via the Elasticsearch SAML realm.
#
#app_search.auth.source: standard
#
# (SAML only) Name of the realm within the Elasticsearch realm chain.
#
#app_search.auth.name:
#
# ---------------------------------- Workers ----------------------------------
#
# Configure the number of worker threads.
#
#worker.threads: 4
#
# ----------------------------------- APIs ------------------------------------
#
# Set to true hide product version information from API responses.
#
#hide_version_info: false
#
# ---------------------------------- Mailer -----------------------------------
#
# Connect App Search to a mailer.
# Docs:
# https://swiftype.com/documentation/app-search/self-managed/configuration
#
#email.account.enabled: false
#email.account.smtp.auth: plain
#email.account.smtp.starttls.enable: false
#email.account.smtp.host: 127.0.0.1
#email.account.smtp.port: 25
#email.account.smtp.user:
#email.account.smtp.password:
#email.account.email_defaults.from:
#
# ---------------------------------- Logging ----------------------------------
#
# Choose your log export path.
#
#log_directory: log
#
# Log level can be: debug, info, warn, error, fatal, or unknown.
#
#log_level: info
#
# Log format can be: default, json
#
#log_format: default
#
# Choose your Filebeat logs export path.
#
#filebeat_log_directory: log
#
# Enable logging app logs to stdout (enabled by default).
#
#enable_stdout_app_logging: true
#
# Enable ECS-style API and Analytics Logs.
#
#enable_ecs_logs: false
#
# ---------------------------------- TLS/SSL ----------------------------------
#
# Configure TLS/SSL encryption.
#
#app_search.ssl.enabled: false
#app_search.ssl.keystore.path:
#app_search.ssl.keystore.password:
#app_search.ssl.keystore.key_password:
#app_search.ssl.redirect_http_from_port:
#
# ---------------------------------- Session ----------------------------------
#
# Set key to persist user sessions through process restarts.
#
#secret_session_key:
#
# ----------------------------- Diagnostics report ----------------------------
#
# Path where diagnostic reports will be generated.
#
#diagnostic_report_directory: diagnostics

Elastic App Search 入门的更多相关文章

  1. Solutions:如何运用Elastic App Search快速建立出色的React搜索体验

    建立搜索体验是一项艰苦的工作. 乍一看似乎很容易:建立一个搜索栏,将数据放入数据库,然后让用户输入对该数据库的查询. 但是,在数据建模,底层逻辑以及(当然)总体设计和用户体验方面,有很多事情要考虑. ...

  2. Elastic App Search 快速构建 ES 应用

    公号:码农充电站pro 主页:https://codeshellme.github.io App Search 是 Elastic 家族中的一个产品,它可以帮助我们(基于 ES)快速高效的构建搜索应用 ...

  3. HTML5手机APP开发入门(2)

    HTML5手机APP开发入门(2) 课程内容 使用IonicFramework v2 + angular 2 完成一个简单的联系人列表的操作,有三个页面: ListPage,DetailPage,Ad ...

  4. HTML5手机APP开发入门(1)

    HTML5手机APP开发入门(1) 开发框架 Ionicframework V2 + Angular 2 具体内容可以参考一下网站 http://ionicframework.net/ http:// ...

  5. 微信公众平台开发:Web App开发入门

    WebApp与Native App有何区别呢?Native App:1.开发成本非常大.一般使用的开发语言为JAVA.C++.Objective-C.2.更新体验较差.同时也比较麻烦.每一次发布新的版 ...

  6. 一看就懂的Android APP开发入门教程

    一看就懂的Android APP开发入门教程 作者: 字体:[增加 减小] 类型:转载   这篇文章主要介绍了Android APP开发入门教程,从SDK下载.开发环境搭建.代码编写.APP打包等步骤 ...

  7. 初学者福音——10个最佳APP开发入门在线学习网站

    根据Payscale的调查显示,现在的APP开发人员的年薪达到:$66,851.这也是为什么那么多初学的开发都想跻身到APP开发这行业的主要原因之一.每当你打开App Store时候,看着琳琅满目的A ...

  8. elasticsearch.net search入门使用指南中文版(翻译)

    elasticsearch.net search入门使用指南中文版,elasticsearch.Net是一个非常底层且灵活的客户端,它不在意你如何的构建自己的请求和响应.它非常抽象,因此所有的elas ...

  9. elasticsearch.net search入门使用指南中文版

    原文:http://edu.dmeiyang.com/book/nestusing.html elasticsearch.net为什么会有两个客户端? Elasticsearch.Net是一个非常底层 ...

随机推荐

  1. Java8 函数式【1】:一文读懂逆变

    Java8 函数式[1]:一文读懂逆变 禁止转载 pure function 协变 逆变 Java8 引入了函数式接口,从此方法传参可以传递函数了,有人说: 不就是传一个方法吗,语法糖! lambda ...

  2. 洛谷P2709 小B的询问 莫队做法

    题干 这个是用来学莫队的例题,洛谷详解 需要注意的一点,一定要分块!不然会慢很多(直接TLE) 其中分块只在排序的时候要用,并且是给问题右端点分块 再就是注意add与del函数里的操作,增加数量不提, ...

  3. Java + Selenium + OpenCV解决自动化测试中的滑块验证

    最近工作过程中,一个常用的被测网站突然增加了滑块验证环节,导致整个自动化项目失效了. 为了解决这个滑块验证问题,在网上查阅了一些资料后,总结并实现了解决方案,现记录如下. 1.滑块验证思路 被测对象的 ...

  4. CF1703C Cypher 题解

    题意:模拟一个 \(n\) 位密码锁. 做法:直接模拟,注意往后推,即若为 \(U\) 变为 \(D\),若为 \(D\) 变为 \(U\).注意 \(0\) 和 \(9\) 进行操作时的特判. #i ...

  5. YII容器类依赖注入

    程序 = 算法 + 数据结构 数据结构 制约了 算法的===>>>>依赖注入 依赖注入也就是解数据结构和算法耦合的思想 <?php /** * Created by Ph ...

  6. 关于javascript中this

    ------------恢复内容开始------------ 1 var number = 5; 2 var obj = { 3 number: 3, 4 fn1: (function () { 5 ...

  7. DolphinScheduler 线上 Meetup 视频回放(07.25)

    上周六下午 DolphinScheduler 社区联合 Doris 社区进行了 2020 年首次线上 Meetup,各位讲师都做了非常精彩的分享,也吸引了 1900 多位技术伙伴观看. 其中 Dolp ...

  8. ROS机械臂 Movelt 学习笔记5 | MoveIt Commander Scripting

    前一讲python接口中提到moveit_commander 包.这个包提供了用于运动规划.笛卡尔路径计算以及拾取和放置的接口. moveit_commander 包还包括一个命令行接口程序movei ...

  9. 让Python更优雅更易读(第一集)

    变量和注释 1.变量 在编写变量尽量要让其清晰只给,让人清除搞清楚代码的意图 下方两段代码作用完全一样,但第二段代码是不是更容易让人理解 value = s.strip() username = in ...

  10. Codeforces 1715E - Long Way Home

    又是废掉的一个div2啊 第一次在学校熬夜打cf,开心还看到了自己最喜欢的斜率优化ohhh 链接 :E - Long Way Home 看到那个平方就可以靠感觉认为是斜率优化了.... 感觉似不似有点 ...