From 9915f61f909996f0cdbf3efdb6532124a7341f46 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Tue, 11 Feb 2014 19:29:56 +0100 Subject: [PATCH] fix highlight_query in percolator highlight_query caused UnsupportedOperationException --- .../test/percolate/highlight_percolator.yaml | 37 +++++++++++++++++++ .../percolator/PercolateContext.java | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 rest-api-spec/test/percolate/highlight_percolator.yaml diff --git a/rest-api-spec/test/percolate/highlight_percolator.yaml b/rest-api-spec/test/percolate/highlight_percolator.yaml new file mode 100644 index 0000000000000..11988cea3ac01 --- /dev/null +++ b/rest-api-spec/test/percolate/highlight_percolator.yaml @@ -0,0 +1,37 @@ +--- +"Basic percolation highlight query test": + + - do: + indices.create: + index: test_index + + - do: + index: + index: test_index + type: .percolator + id: test_percolator + body: + query: + match: + foo: bar + + - do: + indices.refresh: {} + + - do: + percolate: + index: test_index + type: test_type + body: + doc: + foo: "bar foo" + size: 1 + highlight: + fields: + foo: + highlight_query: + match: + foo: foo + + - match: {'total': 1} + diff --git a/src/main/java/org/elasticsearch/percolator/PercolateContext.java b/src/main/java/org/elasticsearch/percolator/PercolateContext.java index a728d4d2a9720..ba2a803523a68 100644 --- a/src/main/java/org/elasticsearch/percolator/PercolateContext.java +++ b/src/main/java/org/elasticsearch/percolator/PercolateContext.java @@ -470,7 +470,7 @@ public AnalysisService analysisService() { @Override public IndexQueryParserService queryParserService() { - throw new UnsupportedOperationException(); + return indexService.queryParserService(); } @Override