Support Questions
Find answers, ask questions, and share your expertise

Using multivalued Fields in Atlas Search

New Contributor

Hi Community,
as part of our use case, we assign multiple values of the same attribute to certain entities. What we would like to do next then, is to find these entities by (one or multiple) of the assigned values through search.

 

Let me give an example to elaborate on this:

Let's say we have an entity of a type called Dataset.

Dataset has an attribute called tags of type array<string>.

In tags we put multiple strings; maybe about a product, branch or country a Dataset belongs to (note that a Dataset may belong to multiple products, branches, etc.).

 

Assigning the values via putting them in the tags attribute of a Dataset is no problem. What we have not been able to achieve is to search for Datasets using the tags attribute as it is of type array<string> (or multivalued).

 

To my knowledge, no search type offers this functionality. Something like:

FROM Dataset WHERE tags CONTAINS "tag_value_to_search_by"

is not possible via Advanced Search. There only is the LIKE operator in the DSL and in Basic Search the contains also only works with String attributes.

 

So my question is: Am I missing something or is the described functionality to search with multivalued attributes just not there? And if so, are there any workarounds or plans to add it in the future?

2 REPLIES 2

Cloudera Employee

Hi @benthor ,

 

To search with multiple values you have assigned for a particular attribute of an entity, could you try to filter by specifying the values in the square brackets and see if it helps? 

from Dataset where tags = ["valueA", "valueB"]

 

Thanks,
Prashanth Vishnu

New Contributor

Hey @pvishnu,

thanks for your reply! I appreciate it.

 

Unfortunately, the proposed solution does not give the wanted result. Also, as far as I could find it in the docs, the 

from Dataset where tags = ["valueA", "valueB"]

 syntax is expected to be equal to:

from Dataset where tags = "valueA" or tags = "valueB"

(see: https://atlas.apache.org/#/SearchAdvance). Meaning, to my understanding, it is primarily syntactical sugar for equality tests on single-valued attributes.

 

Any other ideas?