jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Szymon Kuzniak <skuzniak.cognif...@wp.pl>
Subject XPath position() issues
Date Tue, 17 Oct 2006 11:55:37 GMT
Hello
I started working on position() function in XPath query. I was trying to
add support for other than equality comparisons for it. But during this,
I noticed that position isn't actually working. During tree traverse,
when position function is found, only index of node is set up as the
number which position should be equal, and nothing is added to
query(example: if query is //node1[position()=3], then only operation
node.setIndex(3) is invoked). Also position of node is not indexed in
Lucene, so searching with this function is not possible. I decided to
fix this, adding position of node to Lucene index, and adding another
query when position function is found during tree traverse. But this
operation also requires that all adjacent nodes needs to be reindexed,
when tree structure changes, what I provided by reindexing all children
of a parent of a deleted node, when Event.NODE_REMOVED will come. I also
manage to provide support for <, <=, >, >= operators, by using
RangeQuery object. Now I am testing my solution, and will try to post a
patch, but I would like to know if you are ok with indexing position of
node, and reindexing all adjacent nodes after delete.
Also you are currently dealing with position function in
LocationStepQuerytNode, what causes problems when using this function
with logical operators(AND, OR) because it is not considered in creating
query, so this function is ignored. Why it is handled in
LocationStepQueryNode??

Best Regards
Simon
-- 
Szymon Kuzniak
szymon.kuzniak( at )cognifide.com
Skype: skuzniak
Cognifide Poland
Poznan


Mime
View raw message