Skip to content

C# add ShowMatchesPosition in SearchQuery setting made search output error #428

@jennyesoo

Description

@jennyesoo

Describe the bug
Using ShowMatchesPosition in a SearchQuery, the search output fails to match the structure.

To Reproduce
Steps to reproduce the behavior:

  • SearchQuery setting

SearchQuery query = new SearchQuery { ShowMatchesPosition = true };

  • output is

image

  • I would like to search some query and then get error.

code is
ISearchable<IReadOnlyDictionary<string, string>> output = await _client.Index(_indexName).SearchAsync<IReadOnlyDictionary<string, string>>(input, query);

Error is
System.Text.Json.JsonException: 'The JSON value could not be converted to System.String. Path: $.hits[0]._matchesPosition | LineNumber: 0 | BytePositionInLine: 36568.'

  • check if There is an issue with the output structure in Meilisearch.ISearchable.cs

image

Expected behavior
The SearchAsync can be used flexibly.
ISearchable<T> output = await _client.Index(_indexName).SearchAsync<T>(input, query);

Meilisearch version:
Melisearch - [v1.2.0-rc.3]
C# -

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions