top-search-queries

command
v1.54.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 12 Imported by: 0

README

Scripts

Although the Scripts directory is housed within the dp-search-api repository, it is totally separate from the Search API itself.

The intention is that any scripts within the directory are ones that call the Search API independently.

Script for Getting Top Search Results

The get-top-search-results script aims to compare the results of queries to the Search API when the NLP (Natural Language Processing) functionality is either switched on or off.

It calls the live Search API repeatedly using a supplied list of query strings. Each query string is used twice, which is once with the NLP weighting set to false and once with it set to true.

The supplied list of query strings comes from the file named search-queries.txt. These are believed to be the most commonly used queries (by users of the Search API).

The results of each query are written to a CSV file named top-search-query-results.csv, which is created/overwritten, each time the script is run, in the same directory as the script.

From within the scripts/top-search-queries directory, use the following command to run the script and create the csv output:

go run get-top-search-results.go

Or, to change the value of an input parameter, instead of using the default, do something like this:

go run get-top-search-results.go -<parameter-name> <value>

Configuration
Input Parameter Default Description
api_url https://api.beta.ons.gov.uk/v1 The base url for the Search API
input_file_name search-queries.txt The name of the input file including extension
num_results 10 The number of results to fetch for each query

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL