shining a light on the stillness within

even in the midst of chaos. “shining a light on the stillness within” is published by Molly Skeen in House of Haiku.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Terms set query in Elasticsearch

Elasticsearch Terms set query

Terms set query returns document depending on minimal number of exact terms matching into given field.

The only difference between Terms set query and Terms query is that you can provide the minimal number of terms that must match in order to retrieve certain document.

A document’s numeric field name whose value should be used as the required minimum number of terms to match in order to return the document.

A custom script that determines the minimum number of terms that must match in order to return the documents. If you have to dynamically set the number of terms that are required for match then it will be helpful.

Lets first create the index:

Index Sample documents:

Usecase1 result:

Usecase2 Response:

Let’s now look at how the same index data can be retrieved using a dynamic value for minimum should match.

Response:

Below code will be useful for implementing Terms set query using Elasticsearch Java client.

Add a comment

Related posts:

Mi ciudad es chinampa

Estoy. Y del otro lado también estoy yo. Estoy en lo que soy, pero también en lo que no soy. Frente a mí hay un muro, detrás otro, detrás otro. Y más allá, gente trabajando del otro lado. Detrás mío…

12 Tips for Navigating A Cancer Diagnosis

Like many of our program participants, I have heard a provider say those stunning words: “You have cancer.” Three times, actually. Over the 22 years since my initial diagnosis of Stage 3b breast…

An Open Letter to The One Who Had My Doting Attention

Once I was glued to you, almost unknowingly. Couldn’t see a way out, even if I wanted a way out. Which I didn’t. At least, I hadn’t considered it. Then, something happened. I did take a break from…