Using PHP client unable to set unordered searchableAttributes having the same priority

Index settings using the API /1/indexes/moodle/settings has:

"searchableAttributes": [ "unordered(name),unordered(address),unordered(content),unordered(city)" ]

does return a 200 status and sets up the index, but on calling the settings of the index or viewing them in the dashboard displays:

`[searchableAttributes] => Array
[0] => name),address,content,unordered(city

Hey @git

Thanks for reaching out, Iā€™d be happy to assist you!

When you set searchableAttributes at the same priority, it only accepts an array of strings ā€“ all of those attributes will be unordered by default

It is actually not possible to set multiple attributes with the same priority level to ordered. There would be no way to determine which attribute would trump the others if they all returned matches in the same position ā€“ so we default to unordered when attributes are on the same priority level.

Give this a shot, and let me know if you have any other questions.
I look forward to hearing back from you!


1 Like

@nick.vonholtermann Thanks for the explanation. I figured that out by hitting and looking at different iterations of success/failed API calls in the dashboard. :wink:


1 Like

I had the same issue. I really think that this should be made explicit. I.e. return an error message if the user tries to set e.g. an ordered and an unordered field at the same level.