mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-10 06:55:32 +00:00
This allows plugins to plug rescore implementations into Elasticsearch. While this is a fairly expert thing to do I've done my best to point folks to the QueryRescorer as one that at least documents the tradeoffs that it makes. I've attempted to limit the API surface area by removing `SearchContext` from the exposed interface, instead exposing just the IndexSearcher and `QueryShardContext`. I also tried to make some of the class names more consistent and do some general cleanup while I was there. I entertained the notion of moving the `QueryRescorer` to module. After all, it'd be a wonderful test to prove that you can plug rescore implementation into Elasticsearch if the only built in rescore implementation is in the module. But I decided against it because the new module would require a client jar and it'd require moving some more things around. I think if we really want to do it, we should do it as a followup. I did, on the other hand, create an "example" rescore plugin which should both be a nice example for anyone wanting to plug in their own rescore implementation and servers as a good integration test to make sure that you can indeed plug one in. Closes #26208
27 lines
1.0 KiB
Groovy
27 lines
1.0 KiB
Groovy
/*
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
* license agreements. See the NOTICE file distributed with
|
|
* this work for additional information regarding copyright
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
* not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
* KIND, either express or implied. See the License for the
|
|
* specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
|
|
apply plugin: 'elasticsearch.esplugin'
|
|
|
|
esplugin {
|
|
name 'example-rescore'
|
|
description 'An example plugin implementing rescore and verifying that plugins *can* implement rescore'
|
|
classname 'org.elasticsearch.example.rescore.ExampleRescorePlugin'
|
|
}
|