Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cql support for confluence connector #2679

Merged
merged 7 commits into from
Oct 10, 2024
Merged

Conversation

hagen-danswer
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Oct 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2024 4:31pm

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request adds CQL (Confluence Query Language) support to the Confluence connector in Danswer, enhancing its querying capabilities and flexibility.

  • Introduced a new DanswerConfluence class in the backend to handle CQL queries
  • Added advanced configuration options in the frontend, including a CQL query field
  • Updated ConfluenceConnector class to utilize CQL for fetching pages and time-based filtering
  • Simplified the ListInput component in the frontend by using a reusable TextArrayField
  • Implemented an 'Advanced Options' toggle in the DynamicConnectorCreationForm for better user experience

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

@@ -1,5 +1,6 @@
"use client";

import React from "react";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Unnecessary import of React in a file using 'use client' directive

@@ -56,8 +57,55 @@
)


class DanswerConfluence(Confluence):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this class is necessary to make cql quries work. read comment

def _replace_cql_time_filter(
cql_query: str, start_time: datetime, end_time: datetime
) -> str:
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ensures that the cql properly contains no overlapping lastmodified query parameters

For example, entering "https://your-company.atlassian.net/wiki" as the Wiki Base URL, "KB" as the Space, and "164331" as the Page ID will index the specific page at https:///your-company.atlassian.net/wiki/spaces/KB/pages/164331/Page. If you leave the Page ID empty, it will index the entire KB space.

Selecting the "Index Recursively" checkbox will index the specified page and all of its children.`,
subtext: `Specify the base URL of your Confluence instance, the space name, and optionally a specific page ID to index. If no page ID is provided, the entire space will be indexed. If no space is specified, all available Confluence spaces will be indexed.`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less yapping

@@ -23,6 +24,61 @@ const DynamicConnectionForm: FC<DynamicConnectionFormProps> = ({
setSelectedFiles,
values,
}) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added an advanced_values section

@hagen-danswer hagen-danswer added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit 1f4fe42 Oct 10, 2024
7 checks passed
@Weves Weves deleted the add-cql-support branch October 10, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants