You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by alartin <al...@gmail.com> on 2007/03/19 09:59:44 UTC
Impossible to manipulate lucene directly?
Hi, all
What can I do if I need some search engine like search functions rather
than XPath or SQLs? For example, I store some information in nodes, say one
webpage content per node and I want to find "similar pages" according to
their cotents. This is a simple task when I use lucene directly. But what
can I do if I use jackrabbit as underlying layer?
And what can I do if I need some short description of the hit and
highlight the query terms??
It seems Lucene is only used as a search library to implement the JCR
sepecification, doesn't it? Is it possible to manipulate Lucene directly?
--
View this message in context: http://www.nabble.com/Impossible-to-manipulate-lucene-directly--tf3425757.html#a9548316
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Impossible to manipulate lucene directly?
Posted by Marcel Reutegger <ma...@gmx.net>.
alartin wrote:
> PS:
> I think there are two level in search: System level and Application level.
> The core of system level search is QueryHandler and jackrabbit uses lucene
> to implements. It is a general method to handle all nodes and properties.
> But sometimes, I am much interested in the search of application level. For
> example, a webpage node may contain
> url property, title property, image nodes, and content nodes. As a user, I
> am only interested in index and search title and content rather than url
> property and other nodes which are considered in system level.
> So the question is same to how to custom application level index and query.
> The only way I thought is to develop your own index and search module using
> Lucene and handle all the events include updating, re-indexing yourself. Of
> course, there must be a lot of redundance and hard problems(such as
> verions). Any helps?
I don't see why the current query functionality is not sufficient? if you model
your content properly you could have a query like:
//element(*, my:page)[jcr:like(@title, 'JCR%') and jcr:contains(my:content, 'foo')]
regards
marcel
Re: Impossible to manipulate lucene directly?
Posted by alartin <al...@gmail.com>.
PS:
I think there are two level in search: System level and Application level.
The core of system level search is QueryHandler and jackrabbit uses lucene
to implements. It is a general method to handle all nodes and properties.
But sometimes, I am much interested in the search of application level. For
example, a webpage node may contain
url property, title property, image nodes, and content nodes. As a user, I
am only interested in index and search title and content rather than url
property and other nodes which are considered in system level.
So the question is same to how to custom application level index and query.
The only way I thought is to develop your own index and search module using
Lucene and handle all the events include updating, re-indexing yourself. Of
course, there must be a lot of redundance and hard problems(such as
verions). Any helps?
alartin wrote:
>
> Hi, all
>
> What can I do if I need some search engine like search functions rather
> than XPath or SQLs? For example, I store some information in nodes, say
> one webpage content per node and I want to find "similar pages" according
> to their cotents. This is a simple task when I use lucene directly. But
> what can I do if I use jackrabbit as underlying layer?
> And what can I do if I need some short description of the hit and
> highlight the query terms??
> It seems Lucene is only used as a search library to implement the JCR
> sepecification, doesn't it? Is it possible to manipulate Lucene directly?
>
--
View this message in context: http://www.nabble.com/Impossible-to-manipulate-lucene-directly--tf3425757.html#a9549173
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Impossible to manipulate lucene directly?
Posted by Alexandru Popescu <th...@gmail.com>.
On 3/19/07, alartin <al...@gmail.com> wrote:
>
> Hi, all
>
> What can I do if I need some search engine like search functions rather
> than XPath or SQLs? For example, I store some information in nodes, say one
> webpage content per node and I want to find "similar pages" according to
> their cotents. This is a simple task when I use lucene directly. But what
> can I do if I use jackrabbit as underlying layer?
> And what can I do if I need some short description of the hit and
> highlight the query terms??
> It seems Lucene is only used as a search library to implement the JCR
> sepecification, doesn't it? Is it possible to manipulate Lucene directly?
I would also be interested to hear some possible suggestions for this question.
./alex
--
.w( the_mindstorm )p.
> --
> View this message in context: http://www.nabble.com/Impossible-to-manipulate-lucene-directly--tf3425757.html#a9548316
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
Re: Impossible to manipulate lucene directly?
Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Alexandru,
Alexandru Popescu wrote:
> Thanks for the answer Marcel. At the first glance it looks like what
> you are saying is that this cannot be done through JCR API, which is
> something I already was aware of. What I am really wondering is if
> there is any way I can put my hands on the Lucene classes so that I
> can use those for querying the indexing (so not JCR API, but rather a
> "hack").
in theory you can of course create your own IndexReaders on the index
directories and then execute your own queries, but that won't be something
supported by the jackrabbit devs.
regards
marcel
Re: Impossible to manipulate lucene directly?
Posted by Alexandru Popescu <th...@gmail.com>.
On 3/19/07, Marcel Reutegger <ma...@gmx.net> wrote:
> alartin wrote:
> > What can I do if I need some search engine like search functions rather
> > than XPath or SQLs? For example, I store some information in nodes, say one
> > webpage content per node and I want to find "similar pages" according to
> > their cotents. This is a simple task when I use lucene directly. But what
> > can I do if I use jackrabbit as underlying layer?
>
> well, not much, because the API you are using is JCR and not lucene. but see
> also below.
>
> > And what can I do if I need some short description of the hit and
> > highlight the query terms??
>
> you have to create that manually.
>
> > It seems Lucene is only used as a search library to implement the JCR
> > sepecification, doesn't it?
>
> that's correct.
>
> > Is it possible to manipulate Lucene directly?
>
> no.
>
> But here's what you can do: create jira issues and describe exactly what you
> would like to see as an enhancement. also try to think about how to integrate
> this into jackrabbit or the query languages without affecting JCR compliance.
> e.g. I could imagine a pseudo property or function in XPath: jr:highlight()
> which returns an xml snippet with text extracts and highlighted search terms.
>
> regards
> marcel
>
Thanks for the answer Marcel. At the first glance it looks like what
you are saying is that this cannot be done through JCR API, which is
something I already was aware of. What I am really wondering is if
there is any way I can put my hands on the Lucene classes so that I
can use those for querying the indexing (so not JCR API, but rather a
"hack").
./alex
--
.w( the_mindstorm )p.
Re: Impossible to manipulate lucene directly?
Posted by Marcel Reutegger <ma...@gmx.net>.
alartin wrote:
> What can I do if I need some search engine like search functions rather
> than XPath or SQLs? For example, I store some information in nodes, say one
> webpage content per node and I want to find "similar pages" according to
> their cotents. This is a simple task when I use lucene directly. But what
> can I do if I use jackrabbit as underlying layer?
well, not much, because the API you are using is JCR and not lucene. but see
also below.
> And what can I do if I need some short description of the hit and
> highlight the query terms??
you have to create that manually.
> It seems Lucene is only used as a search library to implement the JCR
> sepecification, doesn't it?
that's correct.
> Is it possible to manipulate Lucene directly?
no.
But here's what you can do: create jira issues and describe exactly what you
would like to see as an enhancement. also try to think about how to integrate
this into jackrabbit or the query languages without affecting JCR compliance.
e.g. I could imagine a pseudo property or function in XPath: jr:highlight()
which returns an xml snippet with text extracts and highlighted search terms.
regards
marcel