mirror of
				https://github.com/simon987/sist2.git
				synced 2025-11-04 01:36:51 +00:00 
			
		
		
		
	Fix total count for ES 7.5
This commit is contained in:
		
							parent
							
								
									e9b6e1cdc2
								
							
						
					
					
						commit
						402b103c49
					
				@ -6,7 +6,7 @@
 | 
			
		||||
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const char *const Version = "1.2.7";
 | 
			
		||||
static const char *const Version = "1.2.8";
 | 
			
		||||
static const char *const usage[] = {
 | 
			
		||||
        "sist2 scan [OPTION]... PATH",
 | 
			
		||||
        "sist2 index [OPTION]... INDEX",
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -499,8 +499,7 @@ function makePreloader() {
 | 
			
		||||
function makePageIndicator(searchResult) {
 | 
			
		||||
    let pageIndicator = document.createElement("div");
 | 
			
		||||
    pageIndicator.setAttribute("class", "page-indicator font-weight-light");
 | 
			
		||||
    const totalHits = searchResult["hits"]["total"].hasOwnProperty("value")
 | 
			
		||||
        ? searchResult["hits"]["total"]["value"] : searchResult["hits"]["total"];
 | 
			
		||||
    const totalHits = searchResult["aggregations"]["total_count"]["value"];
 | 
			
		||||
    pageIndicator.appendChild(document.createTextNode(docCount + " / " + totalHits));
 | 
			
		||||
    return pageIndicator;
 | 
			
		||||
}
 | 
			
		||||
@ -547,8 +546,7 @@ function makeStatsCard(searchResult) {
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let stat = document.createElement("span");
 | 
			
		||||
    const totalHits = searchResult["hits"]["total"].hasOwnProperty("value")
 | 
			
		||||
        ? searchResult["hits"]["total"]["value"] : searchResult["hits"]["total"];
 | 
			
		||||
    const totalHits = searchResult["aggregations"]["total_count"]["value"];
 | 
			
		||||
    stat.appendChild(document.createTextNode(totalHits + " results in " + searchResult["took"] + "ms"));
 | 
			
		||||
 | 
			
		||||
    statsCardBody.appendChild(stat);
 | 
			
		||||
 | 
			
		||||
@ -363,7 +363,7 @@ function search(after = null) {
 | 
			
		||||
        },
 | 
			
		||||
        "sort": [
 | 
			
		||||
            {"_score": {"order": "desc"}},
 | 
			
		||||
            {"_tie": {"order":"asc"}}
 | 
			
		||||
            {"_tie": {"order": "asc"}}
 | 
			
		||||
        ],
 | 
			
		||||
        highlight: {
 | 
			
		||||
            pre_tags: ["<mark>"],
 | 
			
		||||
@ -376,11 +376,13 @@ function search(after = null) {
 | 
			
		||||
                font_name: {},
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        aggs: {
 | 
			
		||||
            total_size: {"sum": {"field": "size"}}
 | 
			
		||||
        aggs:
 | 
			
		||||
            {
 | 
			
		||||
                total_size: {"sum": {"field": "size"}},
 | 
			
		||||
                total_count: {"value_count": {"field": "size"}}
 | 
			
		||||
            },
 | 
			
		||||
        size: SIZE,
 | 
			
		||||
    }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    if (after) {
 | 
			
		||||
        q.search_after = [after["_score"], after["_id"]];
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@
 | 
			
		||||
 | 
			
		||||
<nav class="navbar navbar-expand-lg">
 | 
			
		||||
    <a class="navbar-brand" href="/">sist2</a>
 | 
			
		||||
    <span class="badge badge-pill version">v1.2.7</span>
 | 
			
		||||
    <span class="badge badge-pill version">v1.2.8</span>
 | 
			
		||||
    <span class="tagline">Lightning-fast file system indexer and search tool </span>
 | 
			
		||||
    <a style="margin-left: auto" id="theme" class="btn" title="Toggle theme" href="/">Theme</a>
 | 
			
		||||
</nav>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user