# App-search document API?

**URL:** <https://discuss.elastic.co/t/app-search-document-api/216314>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [January 23, 2020, 8:34pm UTC](https://discuss.elastic.co/t/app-search-document-api/216314 "2020-01-23T20:34:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fred\_wang](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@fred\_wang](https://discuss.elastic.co/u/fred_wang)\
**Post date:** [January 23, 2020, 8:34pm UTC](https://discuss.elastic.co/t/app-search-document-api/216314/1 "2020-01-23T20:34:49Z")

</div>

Is there a way to query the documents in an app search engine by more than just id?

I'm scanning document here:

> **[Documents | Swiftype Documentation](https://swiftype.com/documentation/app-search/api/documents#get)**
>
> Learn how to get the most out of Swiftype

and search here:

> **[Search API | Swiftype Documentation](https://swiftype.com/documentation/app-search/api/search)**
>
> Learn how to get the most out of Swiftype

Looks like the only hooks we get is asking for all documents, or a specific document by id, or searching using a text string or number.

What I'm looking for is for a data set like users below, the ability to request a list of documents that match a particular value (e.g. status="Active", or organization contains "Navy")

Is that possible from either the Restful APIs or the Javascript client?

[  
{  
"id": 4,  
"name": "Doe, Ann A. ",  
"rank": "CTR",  
"email": "Ann.a.doe@mail.mil",  
"organization": "Navy • CNIC • CNDW",  
"role": "Authorized User",  
"status": "Active",  
"edipi": "1456741258",  
"date\_created": "2019-03-09",  
"last\_login": "2019-12-20",  
"groups": "CNDW",  
"date\_requested": null  
},  
{  
"id": 5,  
"name": "Doe, Jane T. ",  
"rank": "CTR",  
"email": "jane.t.doe@mail.mil",  
"organization": "Navy • CNIC • EURAFCENT",  
"role": "Authorized User",  
"status": "Active",  
"edipi": "1593574265",  
"date\_created": "2019-04-06",  
"last\_login": "2020-01-03",  
"groups": "CNIC ",  
"date\_requested": null  
},  
...  
]

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [January 24, 2020, 11:51am UTC](https://discuss.elastic.co/t/app-search-document-api/216314/2 "2020-01-24T11:51:10Z")

</div>

Hey @fred_wang,

> What I'm looking for is for a data set like users below, the ability to request a list of documents that match a particular value (e.g. status="Active", or organization contains "Navy")

The first part of that, `status="Active` can be achieved with a [Filter](https://swiftype.com/documentation/app-search/api/search/filters).

The second part, is not possible. We can't currently do a "contains" in a string. I recommend changing your data to have an array of string values:

```auto
"organization": ["Navy", "CNIC", "EURAFCENT"]

```

If you can do that, then what you're describing can be achieved with the following:

```auto
{
  "query": "",
  "filters": {
    "any": [
      { "status": "Active" },
      { "organization": "Navy" }
    ]
  }
}

```

Does that make sense?

---

<div class="post-metadata">

**Author:** ![fred\_wang](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@fred\_wang](https://discuss.elastic.co/u/fred_wang)\
**Post date:** [January 24, 2020, 5:51pm UTC](https://discuss.elastic.co/t/app-search-document-api/216314/3 "2020-01-24T17:51:47Z")

</div>

@JasonStoltz, this is exactly what I was looking for! Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 21, 2020, 5:51pm UTC](https://discuss.elastic.co/t/app-search-document-api/216314/4 "2020-02-21T17:51:59Z")

</div>

Closed on February 21, 2020, 5:51pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
