Browse Source

Maintenance: Add code example for count search.

Rolf Schmidt 2 weeks ago
parent
commit
bf4d7abd8a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/search_index_backend.rb

+ 4 - 0
lib/search_index_backend.rb

@@ -314,6 +314,10 @@ remove whole data from index
     }
   ]
 
+  result = SearchIndexBackend.search('Nicole', 'User', only_total_count: true)
+
+  { :total_count => 1 }
+
 =end
 
   def self.search(query, index, options = {})