Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fuzzy in a SameElement Search of a map or struct #33238

Open
LuisaWetzel opened this issue Feb 3, 2025 · 1 comment
Open

Use fuzzy in a SameElement Search of a map or struct #33238

LuisaWetzel opened this issue Feb 3, 2025 · 1 comment

Comments

@LuisaWetzel
Copy link

Describe the bug
I want to combine the sameElement and Fuzzy Search on a map or struct field. Trying to do so I get the response that the serializing of FuzzyItem in same_element is not implemented.

To Reproduce
Steps to reproduce the behavior:

  1. Create the schema:
schema doc {
    document doc {
        field data type map<string, string> {
            indexing: summary
            struct-field key    { indexing: attribute }
            struct-field value  { indexing: attribute }
        }
    }
    fieldset default {
        fields: data
    }
}
  1. Run the following Query:
{
	"yql": "select * from sources doc where data contains sameElement(key contains 'some key', value contains({maxEditDistance:2}fuzzy('Some value')))",
	"tracelevel": 5
}
  1. See error

YQL query parsed: [Invalid query: Serializing of FuzzyItem in same_element is not implemented, please report this as a bug.]
Illegal Query: FUZZY(Some value,2,0,false) value:Some value field is not a string attribute

Full Response:

{
	"trace": {
		"children": [
			{
				"message": "No query profile is used"
			},
			{
				"message": "Invoking chain 'vespa' [com.yahoo.prelude.statistics.StatisticsSearcher@native -> com.yahoo.prelude.querytransform.PhrasingSearcher@vespa -> ... -> federation@native]"
			},
			{
				"children": [
					{
						"message": "YQL query parsed: [Invalid query: Serializing of FuzzyItem in same_element is not implemented, please report this as a bug.]"
					},
					{
						"message": "Federating to [text]"
					},
					{
						"message": "Ignoring fill(null): Hits are unfillable: result.hits().getFilled()=null"
					},
					{
						"message": "Query time query 'data:{key:some key value:Some value}': 2 ms"
					},
					{
						"message": "Summary fetch time query 'data:{key:some key value:Some value}': 0 ms"
					}
				]
			}
		]
	},
	"root": {
		"id": "toplevel",
		"relevance": 1.0,
		"fields": {
			"totalCount": 0
		},
		"errors": [
			{
				"code": 3,
				"summary": "Illegal query",
				"source": "text",
				"message": "FUZZY(Some value,2,0,false) value:Some value field is not a string attribute"
			}
		]
	}
}

Expected behavior
I am able to use fuzzy in the sameElement Search which performs a fuzzy search on the attribute Field of the map or struct.

Environment (please complete the following information):
Dockerized vespa

Vespa version
Vespa version: 8.471.25

Additional context
this works:

{
	"yql": "select * from sources doc where data.value contains({maxEditDistance:2}fuzzy('Some value'))",
	"tracelevel": 3
}

and this works:

{
	"yql": "select * from sources doc where data contains sameElement(key contains 'some key', value contains 'some value')",
	"tracelevel": 3
}
@bratseth
Copy link
Member

bratseth commented Feb 4, 2025

The missing serialization is fixed in 8.473.18 which should be available later today.
Please let us know if this solves your problem.

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

No branches or pull requests

2 participants