You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, an exception is thrown saying that the fields don't exist in the schema. This is because the __lte part is not being taken into account.
There is already code in add() for checking field names without the __lte part, and by changing add_boost() to use this code, the exception goes and the query runs correctly:
def add_boost(self, kwargs, boost_score):
for k, v in kwargs.items():
try:
field_name, rel = k.split("__")
except ValueError:
field_name, rel = k, 'eq'
field = self.schema.match_field(field_name)
if not field:
if (k, v) != ("*", "*"):
# the only case where wildcards in field names are allowed
raise ValueError("%s is not a valid field name" % field_name)
elif not field.indexed:
raise SolrError("Can't query on non-indexed field '%s'" % field_name)
value = field.instance_from_user_data(v)
self.boosts.append((kwargs, boost_score))
Apologies for not providing a patch/pull request, but I'll try to follow up after next week -- for now I have a serious deadline to meet!
The text was updated successfully, but these errors were encountered:
I have a query like this:
However, an exception is thrown saying that the fields don't exist in the schema. This is because the
__lte
part is not being taken into account.There is already code in
add()
for checking field names without the__lte
part, and by changingadd_boost()
to use this code, the exception goes and the query runs correctly:Apologies for not providing a patch/pull request, but I'll try to follow up after next week -- for now I have a serious deadline to meet!
The text was updated successfully, but these errors were encountered: