# Search for categories (Elasticsearch)

**URL:** <https://forum.litium.com/t/search-for-categories-elasticsearch/2342>\
**Category:** Questions\
**Tags:** litium-8\
**Created:** [December 7, 2021, 1:23pm UTC](https://forum.litium.com/t/search-for-categories-elasticsearch/2342 "2021-12-07T13:23:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.clettborn](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/adam.clettborn/32/956_2.png) [@adam.clettborn](https://forum.litium.com/u/adam.clettborn)\
**Post date:** [December 7, 2021, 1:23pm UTC](https://forum.litium.com/t/search-for-categories-elasticsearch/2342/1 "2021-12-07T13:23:54Z")

</div>

Hi,

I’m trying to perform a search for categories, but whatever I do I get an empty result.

I’m using CategorySearchService, which is implemented in the elasticsearch project by default. The search query is cloned from RequestModelAccessor. I’ve tried to set the SearchType to “Category”. I’ve also tried to set PageSize and set the Text to something that I know will give me a result if use the quick search on the site, but for some reason I get no items.

The reason I want to do this is to find categories with a value for a specific field, but I don’t want to first get all categories for the assortment and then filter that list. It would be most efficient to index this value and then use elasticsearch to find it.

Litium version: 8.0

---

<div class="post-metadata">

**Author:** ![adam.clettborn](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/adam.clettborn/32/956_2.png) [@adam.clettborn](https://forum.litium.com/u/adam.clettborn)\
**Post date:** [December 7, 2021, 2:23pm UTC](https://forum.litium.com/t/search-for-categories-elasticsearch/2342/2 "2021-12-07T14:23:25Z")

</div>

Apparently, `CategoryShowRecursively` had to be set to true.

This issue is resolved.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [January 4, 2022, 2:24pm UTC](https://forum.litium.com/t/search-for-categories-elasticsearch/2342/3 "2022-01-04T14:24:17Z")

</div>

Closed on January 4, 2022, 2:24pm UTC

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