TextQuery
The TextQuery API allows us to run full text search on stored objects. The ScanQuery goes over each cache entries and apply the predicate, which is not a very efficient way to query objects. The TextQuery works on Lucene indexes; Elasticsearch and Apache Solr use Lucene for indexing text. It is always advisable to use indexes for querying entries, but one drawback is an index itself takes up space and slows down the data modification (create and update) as every time you modify an entry, the index needs to be rebuilt.
You need to define the metadata to tell Apache Ignite which fields to be indexed. The @QueryTextField annotation enables indexing. But, your cache configuration also needs to enable indexing by setting the setIndexedTypes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access