Skip to main content

Stats

Retrieving Index Statistics in HoppySearch

Understanding the state and performance of your HoppySearch index is crucial for optimizing your search operations. HoppySearch provides a straightforward method for obtaining valuable statistics about your index. With this information, you can gain insights into various aspects of your index, such as total document count, index size, all key key list from Lucene index, default searchable key list, and the last index refresh timestamp.

Follow the instructions below to retrieve statistics about your HoppySearch index:

How to Get Index Statistics

  1. Initial Configuration:

    1. Before you can retrieve index statistics, ensure you have configured your HoppySearch client as detailed in the initial setup documentation.
  2. Retrieve Index Statistics:

    1. To obtain index statistics, use the following code:
    hoppysearch.stats()
    .then(res => {
    console.log('statusCode:', res.status);
    console.log('response text:', res.body);
    })
    .catch(err => {
    console.log(err)
    });
    1. This code will make a request to HoppySearch to fetch statistics about your index.

Upon successful execution, you will receive information about your index, including details such as the total document count, index size, and the timestamp of the last index refresh. This data is invaluable for monitoring and optimizing the performance of your HoppySearch index.


By following these steps, you can effortlessly retrieve essential statistics about your HoppySearch index. Use this information to make informed decisions and fine-tune your search operations for optimal results.