Here muy json:
{
"office": "office 52",
"header": "some test"
}
I have such Java code:
BoolQueryBuilder bqb = QueryBuilders.boolQuery();
if (esLogRequest.getHeader() != null) {
bqb.filter(QueryBuilders.fuzzyQuery("header", esLogRequest.getHeader())
.fuzziness(Fuzziness.AUTO));
}
if (esLogRequest.getOffice() != null) {
bqb.must(QueryBuilders.termQuery("office", esLogRequest.getOffice()));
}
I want such result:
- Searching of header should work with only one part of header or full header. For example:
"header"
in ES is"some test"
and I want search with part of it -"test
" or full name"some test"
- I want to search due to strick meaning. For example:
"office"
in ES is"office 52"
and I want to search only for that meaning"office 52"
In my case first example works when I search for part of text but not full text.
In second case, it works when in ES is record"52"
or "office" and I search for"52"
or"office"
- it works fine. But when in ES is record"office 52"
- I can't find such record (maybe because of space).
What should I do in such cases?