Skip to content

enhance WFS search functionality to include relevance scores#34

Merged
esgn merged 1 commit intomasterfrom
28-search-scores
Apr 10, 2026
Merged

enhance WFS search functionality to include relevance scores#34
esgn merged 1 commit intomasterfrom
28-search-scores

Conversation

@esgn
Copy link
Copy Markdown
Member

@esgn esgn commented Apr 9, 2026

closes #28

Summary

This PR updates gpf_wfs_search_types to propagate relevance scores returned by @ignfab/gpf-schema-store.

The tool now returns an optional score field for each search result when the catalog provides it. When no score is available, the field is omitted from the response.

Changes

  • bump @ignfab/gpf-schema-store from 0.1.2 to 0.1.3
  • update WfsClient to use the scored catalog search API
  • remove the old unscored searchFeatureTypes() helper in favor of searchFeatureTypesWithScores()
  • extend gpf_wfs_search_types output schema with an optional score
  • keep the response clean by omitting score when it is undefined
  • update the README to document that gpf_wfs_search_types can return relevance scores
  • add and update tests for:
    • scored search results in the WFS client
    • score propagation in the MCP tool response
    • omission of score when the catalog does not provide one

Example

Before:

{
  "results": [
    {
      "id": "BDTOPO_V3:batiment",
      "title": "Batiment",
      "description": "..."
    }
  ]
}

After:

{
  "results": [
    {
      "id": "BDTOPO_V3:batiment",
      "title": "Batiment",
      "description": "...",
      "score": 12.5
    }
  ]
}

If no score is returned by the catalog, the score field is not included.

Validation

  • npm test -- --runTestsByPath test/gpf/wfs.test.ts
  • npm test -- --runTestsByPath test/tools/wfs.test.ts

@esgn esgn requested a review from mborne April 9, 2026 11:15
@esgn esgn merged commit 28daf64 into master Apr 10, 2026
2 checks passed
@esgn esgn deleted the 28-search-scores branch April 10, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add search score in gpf_wfs_search_types

2 participants