[英]Java Elastic Search: Search term like
Similar to SQL I want to be able to search for terms, but instead of matching exact terms I want to be able to match terms that contains certain string say "abc". 与SQL相似,我希望能够搜索术语,但我希望能够匹配包含某些字符串(例如“ abc”)的术语,而不是精确匹配术语。
Something like SQL's LIKE "%abc%"
类似于SQL的
LIKE "%abc%"
At the moment I have the full term matcher like: 目前,我有完整的匹配词,例如:
AndFilterBuilder andFilter = FilterBuilders.andFilter();
andFilter.add(FilterBuilders.rangeFilter("@timestamp").gt(start).lt(end));
andFilter.add(FilterBuilders.termFilter("@host", "abc"));
Is there a way to do that? 有没有办法做到这一点? Regex may be?
正则表达式可能是?
尝试使用此:
andFilter.add(FilterBuilders.regexpFilter("@host", "*abc*"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.