Skip to content
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

Draft: feat: added custom score queries #338

Open
wants to merge 2 commits into
base: release/3.0
Choose a base branch
from

Conversation

whitter
Copy link

@whitter whitter commented Jun 30, 2023

Just raising this pull request to get some feedback and opinions on the best approach to adding the ability to provide custom score queries to a Lucene search.

Idea is to allow global configuration of scoring queries on the LuceneIndexOptions, while also also scoring per searcher when creating a new instance to add to the ExamineManager and also adding them just before building a query directly on a searcher.

On executing the main query it is nested inside any score queries that have been added before being passed on to the LuceneSearchExecutor.

The code is just a very rough stab at a first pass to implement the ability to have custom score queries and already has areas of improvement such as:

  • Is the IScoringProfile interface really needed would just building up a collection of CustomScoreQuery class be enough
  • Change the score query list so that a searcher is give its own copy and not have the list pass by ref all the way down

@nzdev
Copy link
Contributor

nzdev commented Jul 6, 2023

Cool to see more interest in this type of querying. I made a start a couple of months ago on how I thought it might make sense to configure Custom Queries in a way similar to the scoring profile concept, though I didn't get a chance to implement it fully. Would be great to work together on a solution. Have a look at nzdev#3 for my thoughts on how to do the configuration in a way consistent with other Examine features.

@whitter whitter changed the title feat: added custom score queries Draft: feat: added custom score queries Jul 11, 2023
@whitter
Copy link
Author

whitter commented Jul 11, 2023

Awesome, just being looking at the work you started.

So the idea is to have a score definition collection that can be added to on the IndexOptions. The definitions in this collection will have a string name, a collection of parameters and a collection of scoring functions.

Then have IQuery functions that allow the configuring of the search provider to know which definitions to use by referencing the name of the definition. Then some implementations within the Examine.Lucene project to actually create the score queries and apply them to the search.

Just wondering if you can outline the thinking/planning with the approach as whole as I'd love to lend a hand.

@nikcio nikcio mentioned this pull request Jul 28, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants