From d776af3e474f48651c90df9a45c64da5dfbbb020 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 8 Nov 2023 14:00:09 +0000 Subject: [PATCH] spotless --- .../CustomUnifiedHighlighterTests.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/lucene/search/uhighlight/CustomUnifiedHighlighterTests.java b/server/src/test/java/org/elasticsearch/lucene/search/uhighlight/CustomUnifiedHighlighterTests.java index 1761b2df89337..bf249ba4409ab 100644 --- a/server/src/test/java/org/elasticsearch/lucene/search/uhighlight/CustomUnifiedHighlighterTests.java +++ b/server/src/test/java/org/elasticsearch/lucene/search/uhighlight/CustomUnifiedHighlighterTests.java @@ -370,10 +370,8 @@ public NYCFilterFactory(Map args) { } @Override - protected SynonymMap loadSynonyms(ResourceLoader loader, - String cname, - boolean dedup, - Analyzer analyzer) throws IOException, ParseException { + protected SynonymMap loadSynonyms(ResourceLoader loader, String cname, boolean dedup, Analyzer analyzer) throws IOException, + ParseException { SynonymMap.Parser parser = new SolrSynonymParser(false, false, analyzer); parser.parse(new StringReader("new york city => nyc, new york city")); return parser.build(); @@ -383,20 +381,22 @@ protected SynonymMap loadSynonyms(ResourceLoader loader, public void testOverlappingPositions() throws Exception { final String[] inputs = { "new york city" }; final String[] outputs = { "new york city" }; - BooleanQuery query = new BooleanQuery.Builder() - .add(new BooleanQuery.Builder() - .add(new TermQuery(new Term("text", "nyc")), BooleanClause.Occur.SHOULD) - .add(new BooleanQuery.Builder() - .add(new TermQuery(new Term("text", "new")), BooleanClause.Occur.MUST) - .add(new TermQuery(new Term("text", "york")), BooleanClause.Occur.MUST) - .add(new TermQuery(new Term("text", "city")), BooleanClause.Occur.MUST) - .build(), BooleanClause.Occur.SHOULD) - .build(), BooleanClause.Occur.MUST) - .build(); + BooleanQuery query = new BooleanQuery.Builder().add( + new BooleanQuery.Builder().add(new TermQuery(new Term("text", "nyc")), BooleanClause.Occur.SHOULD) + .add( + new BooleanQuery.Builder().add(new TermQuery(new Term("text", "new")), BooleanClause.Occur.MUST) + .add(new TermQuery(new Term("text", "york")), BooleanClause.Occur.MUST) + .add(new TermQuery(new Term("text", "city")), BooleanClause.Occur.MUST) + .build(), + BooleanClause.Occur.SHOULD + ) + .build(), + BooleanClause.Occur.MUST + ).build(); Analyzer analyzer = CustomAnalyzer.builder() - .withTokenizer(StandardTokenizerFactory.class) - .addTokenFilter(NYCFilterFactory.class, "synonyms", "N/A") - .build(); + .withTokenizer(StandardTokenizerFactory.class) + .addTokenFilter(NYCFilterFactory.class, "synonyms", "N/A") + .build(); assertHighlightOneDoc("text", inputs, analyzer, query, Locale.ROOT, BreakIterator.getSentenceInstance(Locale.ROOT), 0, outputs); }