org.elasticsearch.index.query.MatchPhraseQueryBuilder Java Examples

The following examples show how to use org.elasticsearch.index.query.MatchPhraseQueryBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MatchPhraseQueryDemo.java    From elasticsearch-full with Apache License 2.0 7 votes vote down vote up
@Test
public void test() throws Exception {
    String key = "this is a";
    MatchPhraseQueryBuilder matchPhraseQueryBuilder = QueryBuilders.matchPhraseQuery("title",key);

    matchPhraseQueryBuilder.boost(10);
    matchPhraseQueryBuilder.analyzer("standard");
    matchPhraseQueryBuilder.slop(2);

       SearchResponse searchResponse = client.prepareSearch()
                .setIndices("my_index")
                .setTypes("my_type")
                .setQuery(matchPhraseQueryBuilder)
                .execute()
                .actionGet();
}
 
Example #2
Source File: BsWebAuthenticationCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setPassword_MatchPhrase(String password, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("password", password);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #3
Source File: BsLabelTypeCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setVirtualHost_MatchPhrase(String virtualHost, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("virtualHost", virtualHost);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #4
Source File: BsElevateWordCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedBy_MatchPhrase(String createdBy, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("createdBy", createdBy);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #5
Source File: BsLabelTypeCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_MatchPhrase(Long updatedTime, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("updatedTime", updatedTime);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #6
Source File: BsWebConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setIncludedDocUrls_MatchPhrase(String includedDocUrls, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("includedDocUrls", includedDocUrls);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #7
Source File: BsKeyMatchCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setTerm_MatchPhrase(String term, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("term", term);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #8
Source File: BsKeyMatchCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_MatchPhrase(Long createdTime, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("createdTime", createdTime);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #9
Source File: BsLabelTypeCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setValue_MatchPhrase(String value, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("value", value);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #10
Source File: BsBoostDocumentRuleCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_MatchPhrase(Long updatedTime, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("updatedTime", updatedTime);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #11
Source File: BsRequestHeaderCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setWebConfigId_MatchPhrase(String webConfigId, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("webConfigId", webConfigId);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #12
Source File: BsDataConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setPermissions_MatchPhrase(String permissions, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("permissions", permissions);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #13
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setNumOfThread_MatchPhrase(Integer numOfThread, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("numOfThread", numOfThread);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #14
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setName_MatchPhrase(String name, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("name", name);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #15
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setMaxAccessCount_MatchPhrase(Long maxAccessCount, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("maxAccessCount", maxAccessCount);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #16
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setIntervalTime_MatchPhrase(Integer intervalTime, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("intervalTime", intervalTime);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #17
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setSortOrder_MatchPhrase(Integer sortOrder, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("sortOrder", sortOrder);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #18
Source File: BsFileAuthenticationCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_MatchPhrase(Long createdTime, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("createdTime", createdTime);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #19
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setExcludedPaths_MatchPhrase(String excludedPaths, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("excludedPaths", excludedPaths);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #20
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setExcludedDocPaths_MatchPhrase(String excludedDocPaths, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("excludedDocPaths", excludedDocPaths);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #21
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setDescription_MatchPhrase(String description, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("description", description);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #22
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setDepth_MatchPhrase(Integer depth, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("depth", depth);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #23
Source File: BsDuplicateHostCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setRegularName_MatchPhrase(String regularName, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("regularName", regularName);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #24
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedBy_MatchPhrase(String createdBy, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("createdBy", createdBy);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #25
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setConfigParameter_MatchPhrase(String configParameter, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("configParameter", configParameter);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #26
Source File: BsFileConfigCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setBoost_MatchPhrase(Float boost, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("boost", boost);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #27
Source File: BsRoleTypeCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_MatchPhrase(Long createdTime, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("createdTime", createdTime);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #28
Source File: EsAbstractConditionQuery.java    From fess with Apache License 2.0 4 votes vote down vote up
protected MatchPhraseQueryBuilder regMatchPhraseQ(String name, Object value) {
    checkEsInvalidQuery(name, value);
    MatchPhraseQueryBuilder matchQuery = QueryBuilders.matchPhraseQuery(name, value);
    regQ(matchQuery);
    return matchQuery;
}
 
Example #29
Source File: BsBadWordCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setSuggestWord_MatchPhrase(String suggestWord, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("suggestWord", suggestWord);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #30
Source File: BsFileAuthenticationCQ.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedBy_MatchPhrase(String updatedBy, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
    MatchPhraseQueryBuilder builder = regMatchPhraseQ("updatedBy", updatedBy);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}