@Test public void testBuildNativeQueryWithWeightedFieldAllWithUser() { context.checking(new Expectations() { { one(fieldBooster).boostField(allEntitiesSearch, "background", fieldBoostFactor); will(returnValue(boostedFieldQueryMask)); } }); String expected = "+(lastName:(foo bar)^2 name:(foo bar) overview:(foo bar) " + "jobs:(foo bar) background:(foo bar)^500 education:(foo bar) title:(foo bar) capabilities:(foo bar))"; assertEquals(expected, sut.buildNativeQuery(searchText, "background", userPersonId)); context.assertIsSatisfied(); }
public String buildNativeQuery(final String searchText, final String weightedField, final long userId) { String queryMask = searchFormatMask; if (weightedField.length() > 0) { queryMask = fieldBooster.boostField(queryMask, weightedField, fieldBoostFactor); } return String.format(queryMask, searchText); }
DirectorySearchLuceneQueryBuilder { public String buildNativeQuery(final String searchText, final String weightedField, final long userId) { String queryMask = searchFormatMask; if (weightedField.length() > 0) { queryMask = fieldBooster.boostField(queryMask, weightedField, fieldBoostFactor); } return String.format(queryMask, searchText); } }
DirectorySearchLuceneQueryBuilder { public String buildNativeQuery(final String searchText, final String weightedField, final long userId) { String queryMask = searchFormatMask; if (weightedField.length() > 0) { queryMask = fieldBooster.boostField(queryMask, weightedField, fieldBoostFactor); } return String.format(queryMask, searchText); } DirectorySearchLuceneQueryBuilder(final String inSearchFormatMask, final LuceneFieldBooster inFieldBooster,
            final int inFieldBoostFactor); }
DirectorySearchLuceneQueryBuilder { public String buildNativeQuery(final String searchText, final String weightedField, final long userId) { String queryMask = searchFormatMask; if (weightedField.length() > 0) { queryMask = fieldBooster.boostField(queryMask, weightedField, fieldBoostFactor); } return String.format(queryMask, searchText); } DirectorySearchLuceneQueryBuilder(final String inSearchFormatMask, final LuceneFieldBooster inFieldBooster,
            final int inFieldBoostFactor); String buildNativeQuery(final String searchText, final String weightedField, final long userId); }
DirectorySearchLuceneQueryBuilder { public String buildNativeQuery(final String searchText, final String weightedField, final long userId) { String queryMask = searchFormatMask; if (weightedField.length() > 0) { queryMask = fieldBooster.boostField(queryMask, weightedField, fieldBoostFactor); } return String.format(queryMask, searchText); } DirectorySearchLuceneQueryBuilder(final String inSearchFormatMask, final LuceneFieldBooster inFieldBooster,
            final int inFieldBoostFactor); String buildNativeQuery(final String searchText, final String weightedField, final long userId);  }