Complex search queries are not supported

Created on 5 September 2024, 15 days ago
Updated 12 September 2024, 9 days ago

Problem/Motivation

When the query that goes into AI Search from Search API is created, there are parse modes that can intercept and transoform the query. This means for instance that the following searches are different:

Who is Michael Jackson
"Who is Michael Jackson"
Who+Is+Michael+Jackson

You can see how these are implemented here: https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/ParseMo...

This will produce the output that is seen there in parseInput method, which means that we can get back a complex array that looks like this instead of a string or array with just one string:

[#conjunction] = AND
[0] = Who
[1] = is
[2] = Michael
[3] = Jackson

At the moment we just pass the first in the array if its an array, which means that in the above case we search for "Who", which makes no sense.

Steps to reproduce

Try to search for "Who is Michael Jackson" and you will get very low scores.

Proposed resolution

Since boolean searches and other advanced methods matters less and you can actually just prompt it - find the exact match "Who is Michael Jackson" we could just take the array and remove the conjunction and pass it.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

AI Search

Created by

🇩🇪Germany Marcus_Johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024