0
votes

I am using Jackrabbit in my project to store file and information.

And I have a custom node type:

<an = 'ApplyNode'>
<ani = 'ApplyNodeInfo'>
<anp = 'ApplyNodeProperty'>
[an:PolicyNode] > nt:hierarchyNode
- anp:PolicyId (string)
- anp:DepartmentId (string)
- anp:PolicyName (string)
- anp:DepartmentName (string)
- anp:AreaName (string)
- anp:IssuanceTime (date)
- anp:ValidTime (date)
- anp:Digest (String)
- anp:PolicyContent (string)

I know that Jackrabbit can use JCR-SQL to query information in nodes. But the JCR-SQL can't meet my needs such as Fuzzy Search and Word Frequency. So I wonder about how to use Lucene to query my information in nodes.

How can I use Lucene API to query in Jackrabbit?

Thx.

2

2 Answers

0
votes

AFAIK jackrabbit does indeed use Lucene to build the indices it needs for fast data lookup at runtime - but it does so internally and it doesn't expose any of the Lucene bits it uses to the "outside", via its API layer. So there's no way you could use Lucene's API to query the Jackrabbit JCR implementation, you'll have to stick with the documented query support for JCR, sorry :(

0
votes

In short, you can write your class to handle indexing. Override org.apache.jackrabbit.core.query.lucene.SearchIndex and add your class to your repository config...

<SearchIndex class="<your class>">

Downside is you'll have to handle the all indexing yourself and you won't be able to use the JCR SearchManager.