Add score column to search_queries (#6253)

* Add score column to search_queries

* Allow user to record search score
This commit is contained in:
Tom Moor
2023-12-06 08:37:46 -05:00
committed by GitHub
parent f494e28ce9
commit cf64da1050
6 changed files with 119 additions and 1 deletions

View File

@@ -30,12 +30,27 @@ class SearchQuery extends Model {
@CreatedAt
createdAt: Date;
/**
* Where the query originated.
*/
@Column(DataType.ENUM("slack", "app", "api"))
source: string;
/**
* The number of results returned for this query.
*/
@Column
results: number;
/**
* User score for the results for this query, -1 for negative, 1 for positive, null for neutral.
*/
@Column
score: number;
/**
* The query string, automatically truncated to 255 characters.
*/
@Column(DataType.STRING)
set query(value: string) {
this.setDataValue("query", value.substring(0, 255));