[关闭]
@xlx9765 2017-06-25T14:40:08.000000Z 字数 1320 阅读 193

课堂练习 徐丽新 2014141093031

0、启动solr

0.1定位techproducts目录

通过命令行进入solr-6.3.0,进行启动。提示java环境问题,于是进行修改环境变量,再次进入显示成功。成功界面如下:
此处输入图片的描述
此处输入图片的描述

0.2 解释0.1过程

根据屏幕显示信息

1理解索引

1.1分析techproduces文件目录

1.4 使用Luke查看索引数据并分析

索引框架有:
左侧:索引条目、词频、索引字段出现次数、编码格式右侧:显示字段排名、出现频率、以及相应字段。

1.4.2Luke选项卡作用

overview显示索引名称、记录条数、字段数目、单词总数;
documents:可向其中加入索引文件;
search:根据输入命令进行查询,如下面的name:ipod命令,下面显示返回的结果,并可对返回记录进行explain;
commits:可选择文件的种类、右侧显示各字段名称、size,以及是否被使用;
plugins:

1.4.3搜索结果:

此处输入图片的描述
此处输入图片的描述
分析结果:选中第一条搜索记录点击explain查看搜索结果,score分数为1.4344,其他结果如图显示

1.4344 weight(name:ipod in 4) [ClassicSimilarity], result of:
1.4344 fieldWeight in 4, product of:
1.4142 tf(freq=2.0), with freq of:
2.0000 termFreq=2.0
2.7047 idf(docFreq=3, docCount=21)
0.3750 fieldNorm(doc=4)。

2

2.1

表达式:http://localhost:8983/solr/techproducts/select?fl=name price feature&fq=manu:Belkin&indent=on&key1=val1&key2=val2&q=iPod&sort=price asc&wt=xml
结果:
此处输入图片的描述

2.2

http://localhost:8983/solr/techproducts/select?fl=name price features popularity&fq=popularity:[5 TO *]&indent=on&key1=val1&key2=val2&key3=val3&q=iPod&sort=inStock desc,price asc&wt=json
此处输入图片的描述

2.3

表达式:http://localhost:8983/solr/techproducts/select?fl=name price score&fq=price:[0 TO 400]&indent=on&key1=val1&key2=val2&key3=val3&q=iPod&sort=popularity desc&wt=json

结果:此处输入图片的描述

2.4

表达式:
http://localhost:8983/solr/techproducts/select?fl=name,price,features,popularity&fq=features=plays&hl.fl=features&hl=on&indent=on&key1=val1&key2=val2&q=iPod&wt=xml
结果:
此处输入图片的描述

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注