首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

solr学习总结

2012-12-25 
solr学习小结solr 查询参数:各条件间以&分隔q:查询fl:返回已储存的内容,control what stored fields are

solr学习小结

solr 查询参数:各条件间以'&'分隔

q:查询

fl:返回已储存的内容,control what stored fields are returned。例如:q=video&fl=*,score

sort:排序,eg: q=video&sort=score asc,price desc&fl=name,id,price

wt:返回的数据类型,eg:q=video&wt=json

?

例子:http://localhost:8983/solr/select/?wt=json&indent=on&q=video+card&fl=name,id&hl=true&hl.fl=name,features

searches for "facet_counts":{ "facet_queries":{}, "facet_fields":{"cat":[ "electronics",16, "memory",6, "card",2, "connector",2, "software",2, "camera",1, "printer",1, "scanner",1],"inStock":[ "true",14, "false",4]}, "facet_dates":{}}}

?

Solr can also generate counts for arbitrary queries. The following example queries for "facet_counts":{ "facet_queries":{"price:[0 TO 100]":2,"price:[100 TO *]":1}, "facet_fields":{}, "facet_dates":{}}}

?

?

One can even facet by date ranges. This example requests counts for the manufacture date ("facet_counts":{ "facet_queries":{}, "facet_fields":{}, "facet_dates":{"manufacturedate_dt":{ "2004-01-01T00:00:00Z":0, "2005-01-01T00:00:00Z":2, "2006-01-01T00:00:00Z":8, "2007-01-01T00:00:00Z":0, "2008-01-01T00:00:00Z":0, "2009-01-01T00:00:00Z":0, "gap":"+1YEAR", "end":"2010-01-01T00:00:00Z"}}}}?

Text fields are typically indexed by breaking the field into words and applying various transformations such as lowercasing, removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.

文本域的索引通常是通过分词,再把各词转为小写,去除复数形式,去除词的状态(现在时,过去时)。

?

?

?

热点排行