기본 콘텐츠로 건너뛰기

10월, 2016의 게시물 표시

ElasticSearch QueryStringQueryBuilder Example

Search using Query DSL curl -XPOST 'http://localhost:9200/product/items/_search?pretty=true' -d '{ "query" : { "filtered" : { "query" : { "query_string" : { "query" : "원피스", "default_field" : "itemName" } }, "filter" : { "and" : [{ "not" : { "term" : { "itemId" : "1000" } } }] } } } } QueryStringQueryBuilder Example QueryStringQueryBuilder builder = new QueryStringQueryBuilder(itemName); builder.defaultField("itemName"); builder.defaultOperator(QueryStringQueryBuilder.Operator.OR); AndFilterBuilder andFilterBuilder = FilterBuilders.andFilter()...