在索尔,我怎样才能在一面数上排成一面呢?我知道我有可以跳过记录的一个面数,但是我怎么知道有多少个面数记录呢?
I have another post which resulted in this SELECT DISTINCT a.ArticleID, COUNT(*) AS KeywordMatch, a.Headline, a.ShortDescription, a.CategoryID, a....
在索尔,我怎样才能在一面数上排成一面呢?我知道我有可以跳过记录的一个面数,但是我怎么知道有多少个面数记录呢?
You need to apply Solr Patch SOLR-2242 to get the Facet distinct count.
The total count can be helpful to paginate.
在Solr 5.3及以上,使用面图获得文件总数,
那对于你们是纯洁的、
facet=on
例如,例如
http://<solr-url>/select?facet=on&indent=on&q=*:*&rows=0&wt=json
然后得到一个侧面对象的响应, 它会看起来像,
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":3,
"params":{
"q":"*:*",
"indent":"on",
"rows":"0",
"facet":"on",
"wt":"json"}},
"response":{"numFound":8,"start":0,"maxScore":1.0,"docs":[]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{},
"facet_ranges":{},
"facet_intervals":{},
"facet_heatmaps":{}}
}
您从 reponse
获得 numFound
,这是该索尔核心中的记录的总数。
<更强 > 另一种方式 更强 >
如果有任何面对面的查询,请使用,
facet=on&json.facet={}
例如,例如
http://<solr-url>/select?facet=on&indent=on&json.facet={}&q=*:*&rows=0&wt=json
然后得到一个侧面对象的响应, 它会看起来像,
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":3,
"params":{
"json.facet":"{}",
"q":"*:*",
"indent":"on",
"rows":"0",
"facet":"on",
"wt":"json"}},
"response":{"numFound":80,"start":0,"maxScore":1.0,"docs":[]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{},
"facet_ranges":{},
"facet_intervals":{},
"facet_heatmaps":{}},
"facets":{
"count":80}}
从 facets
对象获得 count
count ,这是记录的最大数量。
I have another post which resulted in this SELECT DISTINCT a.ArticleID, COUNT(*) AS KeywordMatch, a.Headline, a.ShortDescription, a.CategoryID, a....
I m trying to get the percentage of each video I have in my database based on its view count against all other videos. I m then trying to display all the videos from highest view count to lowest, ...
I have posts, votes, and comments tables. Each post can have N yes votes , N no votes and N comments. I am trying to get a set of posts sorted by number of yes votes. I have a query that does ...
I have a page where I am running an initial SQL query to get a list of subjects, then I loop over this query and run two additional queries for each record returned from the original subjects query (I ...
Can someone recommend a function that can allow me to count and return the number of items in a list? library(stringr) l <- strsplit(words, "a") if(# number of items in list l < 1) ...
My Current query is: SELECT DISTINCT DATE(vote_timestamp) AS Date, COUNT(*) AS TotalVotes FROM `votes` WHERE vote_target_id= 83031 GROUP BY DATE(vote_timestamp) ORDER BY DATE(vote_timestamp) DESC ...
I always forget how to do things like this. I have a database table with birthdates and I want to find out how many people have the same age. I m trying: SELECT TIMESTAMPDIFF( YEAR, birthdate, ...
Can someone help me create an index/count button for a UITableView, like this one? iTunes http://img.skitch.com/20091107-nwyci84114dxg76wshqwgtauwn.preview.jpg Is there an Apple example, or other ...