-
Notifications
You must be signed in to change notification settings - Fork 13
Moved relevance query to default query value #1049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| // __NO_QUERY__ is a temporary band-aid for https://github.com/searchkit/searchkit/pull/1407 | ||
| if (query && query !== '__NO_QUERY__') { | ||
| return this.relevanceQueryMatch(query, searchAttributes, config?.fuzziness) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could still move this to the getQuery function, removing the ability to remove/move the relevanceQueryMatch which hasn't been an ability yet until now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't necessarily mind this approach, but now if you want to add an extra query to this (for example, some kind of extra scoring function) you will also need to re-define this functionality inside of the prop. Seems a bit unwieldy to me for those cases.
Might be better in practice to have a prop that lets you disable the default query?
| getQuery(query, search_attributes, config) { | ||
| const esQuery = this.query(...arguments) | ||
| let queries = Array.isArray(esQuery) ? esQuery : [esQuery] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check just makes sure it's backwards compatible with the old way of returning an array of queries instead of a query on it's own
|
Seems like the category positions aren't working anymore |
|
I have discarded the changes, it was a fix for an issue that only seems to occur locally |
|
This also depends on searchkit/searchkit#1411 right? |
This pr adds the ability to override the relevanceQueryMatch by using it as the default value.
Also moved this functionality to the mixin, so it can be used for the autocomplete as well as the listings
Also removed the array return value by default, keeping it backwards compatible. However if you want to set multiple queries in your callback you should exlicitly define it's behaviour by wrapping it in e.g.
bool.should:As you might guess, this also prepares for neural searching