vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.81k stars 604 forks source link

[bug] YQL with non-existent query embedder is strangely running fine #28159

Closed eostis closed 1 year ago

eostis commented 1 year ago

Using a component id that does not exist does not prevent queries to return results !

image

YQL query: {"offset":0,"hits":20,"input.query(q_384)":"embed(???, query: parot)","ranking":"wpsolr_rank_vector_text","yql":"select wpsolr_id, wpsolr_PID, wpsolr_type, wpsolr_meta_type_s, wpsolr_title, wpsolr_numcomments, wpsolr_comments, wpsolr_displaydate, wpsolr_displaymodified, wpsolr_author, wpsolr_snippet_s, wpsolr_content from Vespa1 where ((wpsolr_type contains ({stem: false}\"post\")) and !(((wpsolr_post_status_s contains ({stem: false}\"draft\")) or (wpsolr_post_status_s contains ({stem: false}\"pending\")) or (wpsolr_post_status_s contains ({stem: false}\"trash\")) or (wpsolr_post_status_s contains ({stem: false}\"future\")) or (wpsolr_post_status_s contains ({stem: false}\"private\")) or (wpsolr_post_status_s contains ({stem: false}\"auto-draft\")))) and (!(!((wpsolr_is_excluded_s contains ({stem: false}\"_wpsolr_undefined\")))) or (wpsolr_is_excluded_s contains ({stem: false}\"n\"))) and ({label:'wpsolr_search_operator_nearest_neighbor_text',approximate:true,targetHits: 100}nearestNeighbor(wpsolr_field_vector_text, q_384))) | all(all(group(wpsolr_type) order(-count()) max(20) each(output(count()))))"}

jobergum commented 1 year ago

The doc for using query side embedder is not perfect and this works because you have just one embedder and not using quotes. So the input to the embedder is "???, query:"

If you have only configured a single embedder, you can skip the embedder id argument and optionally also the quotes.

eostis commented 1 year ago

It worked. 👍

embed(???, "query: parot") is triggering the expected error.

jobergum commented 1 year ago

https://github.com/vespa-engine/documentation/pull/2843