# Limit GitHub Connector to only index files

**URL:** <https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295>\
**Category:** Elastic Search\
**Tags:** elastic-workplace-search\
**Created:** [December 13, 2023, 6:40pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295 "2023-12-13T18:40:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itsmed/32/128739_2.png) [@itsmed](https://discuss.elastic.co/u/itsmed)\
**Post date:** [December 13, 2023, 6:40pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/1 "2023-12-13T18:40:46Z")

</div>

When configuring the Github connector [the docs say](https://www.elastic.co/guide/en/workplace-search/8.11/workplace-search-github-connector.html#github-indexing-rules) that it should be possible to limit what is indexed. Is there a way to index only files ( ie not pull requests and issues ) ?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [December 13, 2023, 7:31pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/2 "2023-12-13T19:31:25Z")

</div>

Hey @itsmed ! Long time!  
Yes, you could filter for `object_type` and choose only Files to include.

I will suggest that you may be more interested in our newer set of [connectors](https://www.elastic.co/guide/en/enterprise-search/current/connectors.html) which are decoupled from Workplace Search and can more easily integrate with other Elasticsearch primitives. Additionally, the [github connector](https://www.elastic.co/guide/en/enterprise-search/current/connectors-github.html) supports Advanced Sync Rules which lets you refine the data that is requested from Github, which is a significant performance improvement over Workplace Search's indexing rules (which only apply _after_ data is fetched).

---

<div class="post-metadata">

**Author:** ![itsmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itsmed/32/128739_2.png) [@itsmed](https://discuss.elastic.co/u/itsmed)\
**Post date:** [December 13, 2023, 8:57pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/3 "2023-12-13T20:57:20Z")

</div>

Hey @Sean_Story hope all is well! I've taken a look at the new connectors, and those look even sweeter! So I have my `connectors/config.yml` with this bit:

```auto
connectors:
-
  connector_id: "keep-it-secret-just-in-case"
  service_type: "github"
  api_key: "hunter1=="
  object_type: "Files"
elasticsearch:
  host: "https://elastic-cloud-url:443"
  api_key: "hunter2=="

```

but I'm still seeing PRs etc being indexed. Poking around I haven't been able to find an example, is there one you could point me to?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [December 13, 2023, 9:45pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/4 "2023-12-13T21:45:21Z")

</div>

Ah - the `object_type` was relevant for the Workplace Search Indexing Rules, but doesn't apply to this Elastic Connector.

You'll want to look at:

- [Connector sync rules | Enterprise Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/enterprise-search/current/sync-rules.html) to understand the concept of "Sync rules" for these connectors
- the [specific capabilities for the Github Connector](https://www.elastic.co/guide/en/enterprise-search/current/connectors-github.html#connectors-github-sync-rules-advanced) when it comes to Advanced sync rules

---

<div class="post-metadata">

**Author:** ![itsmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itsmed/32/128739_2.png) [@itsmed](https://discuss.elastic.co/u/itsmed)\
**Post date:** [December 13, 2023, 10:18pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/5 "2023-12-13T22:18:51Z")

</div>

Ah ok I'm sorted. Sorry for the LMGTFY question, but I appreciate the response all the same!

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [December 14, 2023, 4:03pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/6 "2023-12-14T16:03:37Z")

</div>

😃 it's what I'm here for! There are a lot of docs and lots of overlapping terms. Sometimes you need someone to just give you the right link.

---

<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:** [January 11, 2024, 4:03pm UTC](https://discuss.elastic.co/t/limit-github-connector-to-only-index-files/349295/7 "2024-01-11T16:03:49Z")

</div>

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