Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

With cql, how to get the latest touched pages of a certain space for LangChain's ConfluenceLoader?

Sebastian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 18, 2023

Hi

I am playing around with a document chat via a local LLM (the "AI" enables you to talk to your wiki) with the Python lib LangChain. It uses the Atlassian Python API under the hood and I can pass a cql query as argument.

Goal: Fetch all posts that have been made or touched after 2015-01-01. Or rather: don't fetch the old stuff that nobody uses anymore and has spiderwebs all over the place.

What does not work:

cql_query = 'created+>=+"2015/01/01"+OR+lastModified+>+"2015/01/01"&space="ITpub"'

also the other suggestions here like ..&spaces=~"ITpub" and the like. I get the error

HTTPError: Could not parse cql : created+>=+"2015/01/01"+OR+lastModified+>+"2015/01/01"&space="ITpub"

What works:

cql_query = 'space=ITpub'

cql_query = 'created>="2015/01/01"'

cql_query = 'lastModified>="2015/01/01"'

cql_query = 'created+>=+"2015/01/01"+AND+space="ITpub"+AND+type="page"'

Any ideas are welcome! 

1 answer

1 accepted

2 votes
Answer accepted
Evgenii
Community Champion
June 18, 2023

Hi, @Sebastian 

Why you don't want to use +AND+space="ITpub" instead of &space="ITpub" ?

cql_query = '(created+>=+"2015/01/01"+OR+lastModified+>+"2015/01/01")+AND+space="ITpub"'
Sebastian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2023

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events