Vikentyi
(Vikentyi)
May 24, 2017, 1:36pm
1
Hello. I am new to new version. I used 2.0.0 and it was possible to make a request 'NOT LIKE':
QueryBuilder qb = notQuery( wildcardQuery( "user", "k?mc*" ) );
But in new version I can't find how to make this request with NOT. Could you explain me how to build this request or it is impossible?
QueryBuilder qb = wildcardQuery("user", "k?mc*");
dadoonet
(David Pilato)
May 24, 2017, 1:50pm
2
Use a boolQuery with a must_not
clause.
Vikentyi
(Vikentyi)
May 24, 2017, 2:00pm
3
Thank you. I've done it but thought about any other solution.
Vikentyi
(Vikentyi)
May 24, 2017, 2:50pm
4
I have one question more: in old version I used SearchType.COUNT in Java API to count all matched documents to my query. In new version there is a documentation about COUNT API https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html but how is it implemented in JAVA API?
dadoonet
(David Pilato)
May 24, 2017, 8:51pm
5
Just run a normal search with setSize(0)
and you will get a similar result.
system
(system)
Closed
June 21, 2017, 8:51pm
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.