Changing keyword weight of only one out of 30 properties

Description

Hey! I have a collection with around 30+ properties available, and I want the user, at query time, to choose relevant properties that´s important for their search.

The problem is that right now, from my understanding, to do that in the query_properties field, as exemplified below, requires me to write all other properties that still had the value of 1 for me to consider them:

jeopardy = client.collections.get("JeopardyQuestion")
response = jeopardy.query.bm25(
    query="food",
    query_properties=["question^2", "answer"],
    limit=3
)

The collection’s properties are dynamic and it´s common for new ones to appear, and it´s not feasible for the client to create the list and send to the server.

Ideally, I wanted an option where the code above would work the same, with or without the “answer” property in the list.

Did anyone face this challenge yet? And if so, how do you guys were able to work around this?

Thanks in advance! Appreciate it!

By the way, I wanted to avoid adding a step that get´s all properties of a collections before running the query, simply to avoid any overhead

hi @Marco_Vinicius_Nobre!!

Welcome to our community :hugs:

That’s a really nice feature to have.

Something like: apply_weight that will end up with all properties plus the weighted ones, right?

Do you think that having also something like exclude_query_properties would be helpful?

Thanks!

Hey @DudaNogueira, thanks for the welcome!

I believe that having both would be extremely helpful! The behaviour I was imagine is exactly what you mentioned.

Just to give a brief explantion of what I am trying to do: I am using this feature to implement a sort of “nice_to_have” filters, where if a data has a certain property value, it will score higher, but if it doesn´t, it can still show up at the bottom of the result.

Thanks a lot for the quick response

Hey @DudaNogueira ! Do you know if there are any news regarding this topic?

hi!

we discussed the syntax of:

[“*”, “question^2”, “-title”]

However, this is still in the proposition phase.

We should open a Feature Request. But unfortunately we do not have a ETA as of now :frowning: