This is a resource file containing example queries for the Mcp client to help the client understand how to query a Vespa application.
The example queries demonstrate how to transform Command-line queries into the format required by the Mcp client.:
- A String yql 
- A Map params 

# Note: The examples are based on the Vespa application and schemas used in the news tutorial.
Most likely the Vespa application will be different so the example queries is meant for demonstration purposes only for the Mcp client.
The MCP client would need to adapt the queries to the specific application and schemas it is working with.
For other queries use the getDocumentation tool to find relevant documentation on Vespa's query language, as the examples are not covering all possible queries.

The examples are based on the news tutorial application with the following schemas:

# news.sd
schema news {
    document news {

        field news_id type string {
            indexing: summary | attribute
            attribute: fast-search
        }
        field category type string {
            indexing: summary | attribute
        }
        field subcategory type string {
            indexing: summary | attribute
        }
        field title type string {
            indexing: index | summary
            index: enable-bm25
        }
        field abstract type string {
            indexing: index | summary
            index: enable-bm25
        }
        field body type string {
            indexing: index | summary
            index: enable-bm25
        }
        field url type string {
            indexing: index | summary
        }
        field date type int {
            indexing: summary | attribute
            attribute: fast-search
        }
        field clicks type int {
            indexing: summary | attribute
        }
        field impressions type int {
            indexing: summary | attribute
        }
        field embedding type tensor<float>(d0[50]) {
            indexing: attribute | index
            attribute {
                distance-metric: dotproduct
            }
        }
    }

    fieldset default {
        fields: title, abstract, body
    }

    rank-profile popularity inherits default {
        function popularity() {
            expression: if (attribute(impressions) > 0, attribute(clicks) / attribute(impressions), 0)
        }
        first-phase {
            expression: nativeRank + 100 * popularity
        }
    }
    rank-profile recommendation inherits default {
        first-phase {
            expression: closeness(field, embedding)
        }
    
    }
}


# user.sd
schema user {
    document user {
        
        field user_id type string {
            indexing: summary | attribute
            attribute: fast-search
        }
        field embedding type tensor<float>(d0[50]) {
            indexing: summary | attribute
        }
    }

}

# Example queries 

1. Search all documents of type news
- Command-line query:
    vespa query 'yql=select * from news where true'
- MCP client query:
    {
        "yql": "select * from sources where true",
        "parameters": {
            "sources": "news"
        }
    }


2. Search all documents of the news schema with field abstract containing the word "election"
- Command-line query:
    vespa query 'yql=select * from news where abstract contains "election"'
- MCP client query:
    {
        "yql": "select * from sources where abstract contains 'election'",
        "parameters": {
            "sources": "news"
        }
    }

3. Search all documents of the news schema with fieldset default containing the words "music" and "festival", and retrieving only two hits.
- Command-line query:
    vespa query 'yql=select * from news where default contains "music" and default contains "festival"' 'hits=2'
- MCP client query:
    {
        "yql": "select * from sources where default contains 'music' and default contains 'festival'",
        "parameters": {
            "sources": "news",
            "hits": 2
        }
    }

4. Search all documents of the news schema with range search on field date.
- Command-line query:
    vespa query 'yql=select * from news where date <= 20191110 AND date >= 20191108'
- MCP client query:
    {
        "yql": "select * from sources where date <= 20191110 AND date >= 20191108",
        "parameters": {
            "sources": "news"
        }
    }

5. Search all documents of the news schema with fieldset default containing the phrase "music festival" and order by date descending.
- Command-line query:
    vespa query 'yql=select date from news where default contains phrase("music","festival") order by date desc'
- MCP client query:
    {
        "yql": "select * from sources where default contains phrase('music','festival') order by date desc",
        "parameters": {
            "sources": "news"
        }
    }

6. Search all documents of the news schema grouped by category, with a maximum of 3 hits per category, ordered by count of hits in descending order.
- Command-line query:
    vespa query 'yql=select * from news where true limit 0 | all(group(category) max(3) order(-count())each(output(count())))'
- MCP client query:
    Doesn't work at the moment

7. Search all documents of the news schema with fieldset default containing the word "music" and ranking by popularity.
- Command-line query:
    vespa query 'yql=select * from news where default contains "music"' 'ranking=popularity'
- MCP client query:
    {
        "yql": "select * from sources where default contains 'music'",
        "parameters": {
            "sources": "news",
            "ranking": "popularity"
        }
    }

8. Search all documents of the user schema with field user_id equal to "U33527" and retrieving only the field embedding.
- Command-line query:
    vespa query 'yql=select embedding from user where user_id contains "U33527"'
- MCP client query: # Problem: Retrieving more than embeddings
    {
        "yql": "select embedding from sources where user_id contains 'U33527'",
        "parameters": {
            "sources": "user",
        }
    }

9. Search all documents of the news schema and retrieving three documents for user "U33527" based on nearest neighbor search on the embedding field.
- Command-line query:
    vespa query 'yql=select * from sources news where {targetHits:3}nearestNeighbor(embedding, user_embedding)' \
    'hits=3' \
    'ranking.features.query(user_embedding)={<U33527 embedding>}' \
    'ranking.profile=recommendation'
- MCP client query:
    {
        "yql": "select * from sources where {targetHits:3}nearestNeighbor(embedding, user_embedding)",
        "parameters": {
            "sources": "news",
            "hits": 3,
            "ranking.features.query(user_embedding)": "<U33527 embeddings as a list>",
            "ranking": "recommendation"
        }
    }