feat(utils): Support free text configuration (#6942)

**What**
- Add support for searchable entity properties to configure default free text search when providing a `q` filter
- `@Searchable` decorator to mark a property or relation to be searchable form the current entity

FIXES CORE-1910
This commit is contained in:
Adrien de Peretti
2024-04-05 13:59:40 +00:00
committed by GitHub
parent a0005faa14
commit 21990fcd4b
19 changed files with 424 additions and 205 deletions
@@ -234,6 +234,31 @@ moduleIntegrationTestRunner({
})
describe("list", () => {
it("should list all product that match the free text search", async () => {
const data = buildProductOnlyData({
title: "test product",
})
const data2 = buildProductOnlyData({
title: "space X",
})
const products = await service.create([data, data2])
const result = await service.list({
q: "test",
})
expect(result).toHaveLength(1)
expect(result[0].title).toEqual("test product")
const result2 = await service.list({
q: "space",
})
expect(result2).toHaveLength(1)
expect(result2[0].title).toEqual("space X")
})
describe("soft deleted", function () {
let product