Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The authentication system provides JWT-based authentication with support for Hei
- Bypasses JWT validation for local development

**Authentication Configuration:**

- `AUTH_SOURCE`: Choose between "mock" or "jwt" (default: "jwt")
- `JWKS_URL`: JSON Web Key Set endpoint URL
- `JWT_AUDIENCE`: Intended audience for JWT tokens
Expand Down Expand Up @@ -186,9 +187,9 @@ go run cmd/main.go

**Authentication Configuration:**

- `AUTH_SOURCE`: Choose between "mock" or "jwt"
- `AUTH_SOURCE`: Choose between "mock" or "jwt"
- `JWKS_URL`: JSON Web Key Set endpoint URL
- `JWT_AUDIENCE`: Intended audience for JWT tokens
- `JWT_AUDIENCE`: Intended audience for JWT tokens
- `JWT_AUTH_DISABLED_MOCK_LOCAL_PRINCIPAL`: Mock principal for development (required when AUTH_SOURCE=mock)

**Server Configuration:**
Expand Down Expand Up @@ -328,10 +329,12 @@ export ORG_SEARCH_SOURCE=clearbit
The Clearbit integration supports the following search operations:

**Search by Company Name:**

- Searches for companies using their registered business name
- Falls back to domain-based search for additional data enrichment

**Search by Domain:**

- More accurate search method using company domain names
- Provides comprehensive company information

Expand Down Expand Up @@ -384,7 +387,7 @@ This project uses the [GOA Framework](https://goa.design/) for API generation. Y

#### Installing GOA Framework

Follow the [GOA installation guide](https://goa.design/docs/2-getting-started/1-installation/) to install GOA:
Follow the [GOA installation guide](https://goa.design/docs/1-goa/quickstart/) to install GOA:

```bash
go install goa.design/goa/v3/cmd/goa@latest
Expand Down
4 changes: 2 additions & 2 deletions internal/infrastructure/opensearch/searcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func TestOpenSearchSearcherRender(t *testing.T) {
TagsAll: []string{"active", "governance"},
},
expectedError: false,
expectedFields: []string{"must", "active", "governance"},
expectedFields: []string{"filter", "active", "governance"},
},
{
name: "render query with both tags and tags_all",
Expand All @@ -288,7 +288,7 @@ func TestOpenSearchSearcherRender(t *testing.T) {
TagsAll: []string{"active", "governance"},
},
expectedError: false,
expectedFields: []string{"must", "should", "public", "active", "governance"},
expectedFields: []string{"filter", "should", "public", "active", "governance"},
},
{
name: "render query with multiple criteria",
Expand Down
2 changes: 1 addition & 1 deletion internal/infrastructure/opensearch/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const queryResourceSource = `{
{{- end }}
"query": {
"bool": {
"must": [
"filter": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for collecting all the performance results. Nice work!

Based on the tradeoffs, maybe we should include a conditional to use must for the name query parameter (I think we still need some querying using relevance/scoring, which I understand must is built for) and use filter for the others (exact match). For example:

{
    "size": 50,
    "query": {
        "bool": {
            "must": [
                {
                    "multi_match": {
                        "query": "linux fouDNation",
                        "type": "bool_prefix",
                        "fields": [
                            "name_and_aliases",
                            "name_and_aliases._2gram",
                            "name_and_aliases._3gram"
                        ]
                    }
                }
            ],
            "filter": [
                {
                    "term": {
                        "latest": true
                    }
                },
                {
                    "term": {
                        "object_type": "project"
                    }
                },
                {
                    "term": {
                        "data.category": "Sandbox"
                    }
                },
                {
                    "term": {
                        "parent_refs": "project:16b22a7a-0992-4f4a-a825-534669bde81d"
                    }
                }
            ]
        }
    },
    "sort": [
        ...
    ]
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. Thank you! Eric had told me that using the filter clause doesn't really make sense for the search - you might be right that some terms could use filter and others must, although for now I'm going to close the PR.

{
"term": {"latest": true}
}
Expand Down