CommonSearchSourceBuilderAssemblerImpl implements CommonSearchSourceBuilderAssembler { protected void setQuery( SearchSourceBuilder searchSourceBuilder, BaseSearchRequest baseSearchRequest) { searchSourceBuilder.query(getQueryBuilder(baseSearchRequest)); }  @Override void assemble(
		SearchSourceBuilder searchSourceBuilder,
		BaseSearchRequest baseSearchRequest, SearchRequest searchRequest);  }
@Test public void testPartsWhenAdditiveWillAppendToWhatMainQueryFinds() throws Exception { index("alpha 1", "JournalArticle"); index("alpha 2", "DLFileEntry"); index("bravo 1", "DLFileEntry"); SearchSearchRequest searchSearchRequest = createSearchSearchRequest(); searchSearchRequest.setQuery( new MatchQuery("entryClassName", "DLFileEntry")); addPart("filter", _queries.term("title", "bravo"), searchSearchRequest); assertSearch(searchSearchRequest, "bravo 1"); addPartAdditive( "should", _queries.term("entryClassName", "JournalArticle"), searchSearchRequest); assertSearch(searchSearchRequest, "alpha 1", "bravo 1"); }
@Test public void testPartsWillNarrowDownWhatMainQueryFinds() throws Exception { index("alpha 1", "JournalArticle"); index("alpha 2", "DLFileEntry"); index("bravo 1", "DLFileEntry"); SearchSearchRequest searchSearchRequest = createSearchSearchRequest(); searchSearchRequest.setQuery(new MatchQuery("title", "alpha")); assertSearch(searchSearchRequest, "alpha 1", "alpha 2"); addPart( "filter", _queries.term("entryClassName", "DLFileEntry"), searchSearchRequest); assertSearch(searchSearchRequest, "alpha 2"); }