Skip to content

Commit

Permalink
Spotless again
Browse files Browse the repository at this point in the history
  • Loading branch information
kderusso committed Oct 16, 2024
1 parent 164df1a commit 35c36b9
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,92 @@ setup:
_id: baz
- { "text": "baz - no rule attached" }
- index:
_id: bar2
- { "text": "bar2 - no rule attached" }
_id: foo_no_rule
- { "text": "text search result for foo with no rule attached" }
- index:
_id: bar_no_rule
- { "text": "text search result for bar with no rule attached" }
- index:
_id: foo2
- { "text": "foo2 - second pinned doc for foo" }

- do:
query_rules.put_ruleset:
ruleset_id: test-ruleset
body:
rules:
- rule_id: foo
type: pinned
criteria:
- type: exact
metadata: foo
values: [ foo ]
actions:
ids:
- foo
- foo2
- rule_id: bar
type: exclude
criteria:
- type: exact
metadata: bar
values: [ bar ]
actions:
ids:
- bar

---
"standalone query rules retriever":

- do:
search:
index: test
body:
retriever:
rule:
match:criteria:
foo: foo
bar: bar
ruleset_ids:
test-ruleset
retriever:
standard:
query:
query_string:
query: bar

- match: { hits.hits.size: 3 }
- match: { hits.hits.0._id: foo }
- match: { hits.hits.1._id: foo2 }
- match: { hits.hits.2._id: bar_no_rule }

---
"query rules retriever combined with rrf":

- do:
search:
index: test
body:
retriever:
rule:
match:criteria:
foo: foo
bar: bar
ruleset_ids:
test-ruleset
retriever:
rrf:
retrievers: [
{

},
{

}
]

- match: { hits.hits.size: 3 }
- match: { hits.hits.0._id: foo }
- match: { hits.hits.1._id: foo2 }
- match: { hits.hits.2._id: bar_no_rule }

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.apache.lucene.search.ScoreDoc;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.features.NodeFeature;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.license.LicenseUtils;
import org.elasticsearch.search.builder.PointInTimeBuilder;
Expand All @@ -20,7 +19,6 @@
import org.elasticsearch.search.retriever.CompoundRetrieverBuilder;
import org.elasticsearch.search.retriever.RetrieverBuilder;
import org.elasticsearch.search.retriever.RetrieverParserContext;
import org.elasticsearch.search.retriever.rankdoc.RankDocsQueryBuilder;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xcontent.XContentBuilder;
Expand Down

0 comments on commit 35c36b9

Please sign in to comment.