I want to create a customized CQL field that searches for a content property inside my confluence,
I did the following:
1- Creating a content property via REST post method
2- Indexing this content property by configuring content-property-index-schema inside my atlassian-plugin
=> now my content property is searchable , as I tried to search for it in the search rest call by adding the following in cql parameter of api/search method : content.property[mxdoc1].fileid=1234 => I got results
Now , using CQL field, I discovered that we are calling TermQuery(fieldName, value) that does the query via code. But, what should I put as 1st parameter:fieldName ? How Lucene stored this fieldName?
Can you please help?
I have never done that, but I know Confluence has a kind of âLucene browserâ where you can see how data is stored in Lucene. Try browsing the index and see whether you see your data.
thanks a lot @playsql, this is what I"m trying to do. the software is called Luke, I installed it and picked my âindexâ folder but, Iâm having the following:
java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.codecs.Codec with name âLucene42â does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath.The current classpath supports the following names: [Lucene40, Lucene3x, SimpleText, Appending]
Hello,
You need a specific version of Luke. Lucene had many updates which made the API change a lot, so there is no compatibility between two versions. The error message says you need the codec for Lucene42 and you have codecs for Lucene40 and Lucene3x. The Lucene42 codec has been introduced in Lucene 4.6.0 so you need Luke in version 4.6.0 as well.
Donât forget that sometimes youâll need to check âOpen in Read-Onlyâ and âForce unlockâ, especially if your Confluence application is still running.
The last time I did this kind of thing, which was some time ago and probably with Confluence 5.x, I used lukeall-4.7.1.jar - I have a copy if you canât locate it - mail me david @ davidsimpson.me if you canât find it.
Now, I was able to detect the fiedName parameter of TermQuery via Luke and I got results (please check attached snapshot), but, when I"m calling it inside my code using the same key, I"m not getting any results in my CQL field, any idea how to debug the query behind it in my code? Or, is there something missing?