Skip to content

Best Practices for Using Inclusion/Exclusion Filters with Confluence Data Source in Amazon Bedrock

0

We're using Amazon Bedrock with the Confluence data source to index content for RAG purposes. We want to include all pages under a specific parent page (i.e., a section or folder-like structure) in Confluence. However, the include patterns we've tried yield inconsistent results—sometimes indexing only a few top-level pages or missing all child pages.

We've reviewed the official documentation here: 🔗 https://docs.aws.amazon.com/bedrock/latest/userguide/confluence-data-source-connector.html

In the Inclusion/exclusion filters section, it states:


You can include or exclude crawling certain content. For example, you can specify an exclusion prefix/regular expression pattern to skip crawling any file that contains “private” in the file name. You could also specify an inclusion prefix/regular expression pattern to include certain content entities or content types. If you specify an inclusion and exclusion filter and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

An example of a regular expression pattern to exclude or filter out PDF files that contain "private" in the file name: .*private.*\.pdf

You can apply inclusion/exclusion filters on the following content types:

Space: Unique space key

Page: Main page title

Blog: Main blog title

Comment: Comments that belong to a certain page or blog (e.g., Re: Page/Blog Title)

Attachment: Attachment file name with its extension

Unfortunately, the documentation is not very clear and doesn’t contain enough realistic examples to guide implementation—especially for common use cases like including all pages under a given parent page.

Question: What is the correct inclusion pattern to ensure all pages under a specific parent page are indexed (not just the top-level or overview page)? Could you provide concrete examples of regex patterns that actually work in this context?

asked a year ago935 views

1 Answer
-1

To ensure all pages under a specific parent page are indexed in Amazon Bedrock when using the Confluence data source, you need to use a carefully crafted regular expression pattern. Here are some best practices and examples:

  1. Use a pattern that matches the parent page title and all its child pages: For example, if your parent page is titled "Project X Documentation", you could use: ^Project X Documentation.*$

    This pattern will match the parent page and all pages that start with "Project X Documentation".

  2. If you want to be more specific and ensure you're only getting child pages, you can use: ^Project X Documentation/.+$

    This pattern will match any page that starts with "Project X Documentation/" followed by at least one character, effectively capturing all child pages.

  3. Remember that Confluence often uses a hierarchical structure in page titles. You might see something like: "Parent Page / Child Page / Grandchild Page" In this case, you could use: ^Parent Page(/.*)?$

    This will match "Parent Page" and any pages that start with "Parent Page/" followed by any characters.

  4. If you want to include pages from multiple parent pages, you can use the OR operator (|): ^(Project X|Project Y).*$

    This will include all pages under both "Project X" and "Project Y".

  5. Be cautious with your patterns to avoid unintended matches. For instance, if you have similarly named pages in different spaces, you might want to include the space key in your pattern: ^SPACEKEYXYZ:Project X.*$

It's important to note that the regular expression patterns are case-sensitive. Make sure your patterns match the exact casing of your page titles.

Also, remember that if you're using both inclusion and exclusion patterns, the exclusion patterns take precedence. So, if a page matches both an inclusion and an exclusion pattern, it will be excluded.

Lastly, after applying these patterns, it's crucial to verify the results by checking the indexed content. You may need to adjust your patterns based on the specific structure and naming conventions of your Confluence instance.

If you're still experiencing issues with pages not being indexed as expected, you should double-check the permissions settings in Confluence to ensure that the Bedrock connector has access to all the pages you want to index.
Sources
Connect to Confluence for your knowledge base - Amazon Bedrock
Specify the search range in the Box from Kendra when using the Amazon Kendra Box Connector | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.