Test Datasource
Before going live with a production datasource you might want to set up a test/staging datasource. You can use a test datasource to experiment with the indexing API, or to stage your changes. This test datasource lives in the production environment but doesn’t affect it. You can do this by ensuring that:
- All ranking signals are turned off from a test datasource. This ensures that the production is not affected by a test datasource.
- The test datasource is only visible to select users so that a developer can check results and permissions easily.
Setting up a test datasource is quite easy, you have to go through almost the same steps as you would go through setting up a normal datasource, but there are some differences. The steps are:
1. Setting isTestDatasource
to true
When setting up the datasource using /adddatasource
(link), remember to set the isTestDatasource field to true.
Glean turns off ranking signals from a test datasource. For example, Glean uses document references(link to a document) as one of its ranking signals. A document that is referenced more in other documents will be given more importance then a less referenced one. Glean stops all such signals for a test datasource so that it does not pollute production rankings.
2. Using /betausers
endpoint to give select visibilty to users.
At this stage your test datasource is not affecting the production and it is neither visible to anyone. Now you would like to give selective visibility to it. This can be done using the /betausers
(link) endpoint. This endpoint allows you to control the people who can have visibility to the test datasource. An example command would look like :
This command would give visibility of the test datasource to user1 and user2. This would allow you to test your custom datasource among a small number of users.
Note: For a document to be visible to beta users, they must also have appropriate permissions to view it. For more details about setting permissions, follow the Setting Permissions tutorial.
Was this page helpful?