# Searching for "closest that includes this tag"?

**URL:** <https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200>\
**Category:** Support\
**Created:** [June 15, 2023, 8:20pm UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200 "2023-06-15T20:20:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Cooper](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jason_cooper/32/178_2.png) [@Jason\_Cooper](https://forum.weaviate.io/u/Jason_Cooper)\
**Post date:** [June 15, 2023, 8:20pm UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200/1 "2023-06-15T20:20:20Z")

</div>

Elements in my Weaviate schema include a vector of integer tags as one of their properties. I’d like to be able to filter my search to only those elements that include some particular tag, but it looks like Weaviate doesn’t support the “In” GraphQL operator. Are there plans to support that? Or any suggested work-arounds?

Thanks!

---

<div class="post-metadata">

**Author:** ![dandv](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@dandv](https://forum.weaviate.io/u/dandv)\
**Post date:** [June 16, 2023, 10:30am UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200/2 "2023-06-16T10:30:24Z")

</div>

Is this the feature you’re looking for?

> <https://github.com/weaviate/weaviate/issues/2387>
>
> From \[Filters\](https://weaviate.io/developers/weaviate/current/graphql-reference…s/filters.html) we've got:
> 
> \`\`\`
> where: {
> operator: \<operator\>,
> operands: \[{
> path: \[path\],
> operator: \<operator\>
> \<valueType\>: \<value\>
> }\]
> }
> \`\`\`
> It would be nice to have an \`In \<operator\>\` and an \`arrayValues \<valueType\>\`, so one can do \`{path: objId, operator: In, arrayValues: \['x', 'y', 'z'\]}\`. 
> 
> Use-case (I think this will be more common than meets the eye): doing the data filtering inside the app database (eg Postgres) rather than Weaviate. Using Weaviate for just the ML stuff (vectors, summary, question-answering, etc). One case is the project was already built, and now we're adding vector-search. Wherever the filters (say, faceted search page) are already in place; no need to replicate the schema/filter system over to Weaviate. Another case is the filtering is complex in SQL, and we want to ping Weaviate with the final rows. This is my scenario, I'm using some wild SQL before I land on the rows I want to work with. 
> 
> Anyway, for now I'll roll with
> 
> \`\`\`
> where: {
> operator: Or
> operands: \[{
> path: \["objId"\]
> operator: Equals
> valueString: "x"
> }, { ... }, { ... }\]
> }
> \`\`\`
> 
> Hopefully there's not a perf penalty in so doing (or in the concept I'm feature-requesting either)?

---

<div class="post-metadata">

**Author:** ![etiennedi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/etiennedi/32/44_2.png) [@etiennedi](https://forum.weaviate.io/u/etiennedi)\
**Post date:** [June 16, 2023, 12:50pm UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200/3 "2023-06-16T12:50:35Z")

</div>

Related to this, please also see this naming discussion [here](https://forum.weaviate.io/t/api-feedback-naming-for-new-array-filters-operators/203).

---

<div class="post-metadata">

**Author:** ![Jason\_Cooper](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jason_cooper/32/178_2.png) [@Jason\_Cooper](https://forum.weaviate.io/u/Jason_Cooper)\
**Post date:** [June 16, 2023, 2:22pm UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200/4 "2023-06-16T14:22:28Z")

</div>

I believe that’s exactly it! The issue seems to give this example (moving to ‘Contains’, which seems to be the popular naming choice):

> {path: objId, operator: Contains, arrayValues: [‘x’, ‘y’, ‘z’]}

where objId is presumably a single value and the goal is to return elements where it is one of ‘x’, ‘y’, or ‘z’. I understand from the discussion that input coercion would also allow the reverse, which is what I’m looking for – for example, tag\_ids with dataType=int and:

> {path: [“tag\_ids”], operator: Contains, int: 12}

to return only elements that include 12 in that array property (for example, an element with tag\_ids=[10, 12, 14])?

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [June 16, 2023, 8:43pm UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200/5 "2023-06-16T20:43:48Z")

</div>

This may have changed since the last time I tried, but both “Like” and “Equal” seem to work:

```auto
operator: And,
          operands: [{
              path: ["groups"],
              operator: Like,
              valueString: "School Board"
            }, {
              path: ["groups"],
              operator: Equal,
              valueString:"Public"
            }]

```

Where “groups” is a `text[]` array (previously `string[]`).

---

<div class="post-metadata">

**Author:** ![Jason\_Cooper](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jason_cooper/32/178_2.png) [@Jason\_Cooper](https://forum.weaviate.io/u/Jason_Cooper)\
**Post date:** [June 20, 2023, 3:00pm UTC](https://forum.weaviate.io/t/searching-for-closest-that-includes-this-tag/200/6 "2023-06-20T15:00:05Z")

</div>

I think this worked with a valueInt array and “Equal” operator. Thanks!
