You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Eirikur Hrafnsson <ei...@idega.is> on 2007/05/02 12:47:56 UTC
Lucene ordering not working correctly when limiting the returned results number
Hi,
I'm having a problem with a Lucene search that should order the
results by the modified date and limit the number of results given
back to me. It seems that it always returnes an unorderer list of the
results which is unusable to me...
If I only specify the ordering it seems to work fine but as soon as I
limit it to e.g. 5 results the results aren't the top 5 items from
the unlimited search but just some part (i'm guessing the first
unordered part) of the total result.
Here's my DASL XML
<D:searchrequest xmlns:D='DAV:' xmlns:S='http://jakarta.apache.org/
slide/'>
<D:basicsearch>
<D:select><D:prop><D:getcontentlength/><D:creationdate/
><D:displayname/><D:getlastmodified/></D:prop></D:select>
<D:from><D:scope><D:href>files</D:href><D:depth>infinity</D:depth></
D:scope></D:from>
<D:where><D:and><D:or><D:contains>*</D:contains><S:property-
contains><D:prop><D:displayname/></D:prop><D:literal>*</D:literal></
S:property-contains><S:property-contains><D:prop><D:creator-
displayname/></D:prop><D:literal>*</D:literal></S:property-
contains><S:property-contains><D:prop><D:comment/></
D:prop><D:literal>*</D:literal></S:property-contains></D:or><D:not-is-
collection/></D:and></D:where>
<D:orderby><D:order><D:prop><D:getlastmodified/></
D:prop><D:descending/></D:order></D:orderby>
<D:limit><D:nresults>5</D:nresults></D:limit>
</D:basicsearch></D:searchrequest>
Any ideas or fixes?
Best Regards
Eirikur S. Hrafnsson, eiki@idega.is
Chief Software Engineer
Idega Software
http://www.idega.com
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Lucene ordering not working correctly / ruining limimiting
Posted by Eirikur Hrafnsson <ei...@idega.is>.
Hi, (this kind of a resend)
I'm having a problem with a Lucene search that should order the
results by the modified date and limit the number of results given
back to me. It seems that it always returnes an unorderer list of the
results which is unusable to me since the first 5 values aren't
really the ones I wanted.
After a better check it seems that ordering by modified date or
creation date doesn't work at all, it was a coincidence that the
order was correct in the unlimited search, so the basic problem must
be the ordering. Is something wrong with my DASL XML or is it in Slide?
After a quick debug of AbstractLuceneExpression it seems that the
orderBy parameter in public IBasicResultSet execute(OrderBy orderBy,
int limit), is always null.
Here's my DASL XML
<D:searchrequest xmlns:D='DAV:' xmlns:S='http://jakarta.apache.org/
slide/'>
<D:basicsearch>
<D:select><D:prop><D:getcontentlength/><D:creationdate/
><D:displayname/><D:getlastmodified/></D:prop></D:select>
<D:from><D:scope><D:href>files</D:href><D:depth>infinity</D:depth></
D:scope></D:from>
<D:where><D:and><D:or><D:contains>*</D:contains><S:property-
contains><D:prop><D:displayname/></D:prop><D:literal>*</D:literal></
S:property-contains><S:property-contains><D:prop><D:creator-
displayname/></D:prop><D:literal>*</D:literal></S:property-
contains><S:property-contains><D:prop><D:comment/></
D:prop><D:literal>*</D:literal></S:property-contains></D:or><D:not-is-
collection/></D:and></D:where>
<D:orderby><D:order><D:prop><D:getlastmodified/></
D:prop><D:descending/></D:order></D:orderby>
<D:limit><D:nresults>5</D:nresults></D:limit>
</D:basicsearch></D:searchrequest>
Any ideas or fixes?
Best Regards
Eirikur S. Hrafnsson, eiki@idega.is
Chief Software Engineer
Idega Software
http://www.idega.com
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
Lucene ordering not working correctly / ruining limimiting
Posted by Eirikur Hrafnsson <ei...@idega.is>.
Hi, (this kind of a resend)
I'm having a problem with a Lucene search that should order the
results by the modified date and limit the number of results given
back to me. It seems that it always returnes an unorderer list of the
results which is unusable to me since the first 5 values aren't
really the ones I wanted.
After a better check it seems that ordering by modified date or
creation date doesn't work at all, it was a coincidence that the
order was correct in the unlimited search, so the basic problem must
be the ordering. Is something wrong with my DASL XML or is it in Slide?
After a quick debug of AbstractLuceneExpression it seems that the
orderBy parameter in public IBasicResultSet execute(OrderBy orderBy,
int limit), is always null.
Here's my DASL XML
<D:searchrequest xmlns:D='DAV:' xmlns:S='http://jakarta.apache.org/
slide/'>
<D:basicsearch>
<D:select><D:prop><D:getcontentlength/><D:creationdate/
><D:displayname/><D:getlastmodified/></D:prop></D:select>
<D:from><D:scope><D:href>files</D:href><D:depth>infinity</D:depth></
D:scope></D:from>
<D:where><D:and><D:or><D:contains>*</D:contains><S:property-
contains><D:prop><D:displayname/></D:prop><D:literal>*</D:literal></
S:property-contains><S:property-contains><D:prop><D:creator-
displayname/></D:prop><D:literal>*</D:literal></S:property-
contains><S:property-contains><D:prop><D:comment/></
D:prop><D:literal>*</D:literal></S:property-contains></D:or><D:not-is-
collection/></D:and></D:where>
<D:orderby><D:order><D:prop><D:getlastmodified/></
D:prop><D:descending/></D:order></D:orderby>
<D:limit><D:nresults>5</D:nresults></D:limit>
</D:basicsearch></D:searchrequest>
Any ideas or fixes?
Best Regards
Eirikur S. Hrafnsson, eiki@idega.is
Chief Software Engineer
Idega Software
http://www.idega.com
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Re: Lucene ordering not working correctly when limiting the returned results number
Posted by Eirikur Hrafnsson <ei...@idega.is>.
More info...
After a better check it seems that ordering by modified date or
creation date doesn't work at all, it was a coincidence that the
order was correct in the unlimited search, so the basic problem must
be the ordering. Is something wrong with my DASL XML or is it in Slide?
After a quick debug of AbstractLuceneExpression it seems that the
orderBy parameter in public IBasicResultSet execute(OrderBy orderBy,
int limit), is always null.
-Eiki
On May 2, 2007, at 10:47 AM, Eirikur Hrafnsson wrote:
> Hi,
>
> I'm having a problem with a Lucene search that should order the
> results by the modified date and limit the number of results given
> back to me. It seems that it always returnes an unorderer list of
> the results which is unusable to me...
>
> If I only specify the ordering it seems to work fine but as soon as
> I limit it to e.g. 5 results the results aren't the top 5 items
> from the unlimited search but just some part (i'm guessing the
> first unordered part) of the total result.
>
> Here's my DASL XML
> <D:searchrequest xmlns:D='DAV:' xmlns:S='http://jakarta.apache.org/
> slide/'>
> <D:basicsearch>
> <D:select><D:prop><D:getcontentlength/><D:creationdate/
> ><D:displayname/><D:getlastmodified/></D:prop></D:select>
> <D:from><D:scope><D:href>files</D:href><D:depth>infinity</D:depth></
> D:scope></D:from>
> <D:where><D:and><D:or><D:contains>*</D:contains><S:property-
> contains><D:prop><D:displayname/></D:prop><D:literal>*</D:literal></
> S:property-contains><S:property-contains><D:prop><D:creator-
> displayname/></D:prop><D:literal>*</D:literal></S:property-
> contains><S:property-contains><D:prop><D:comment/></
> D:prop><D:literal>*</D:literal></S:property-contains></D:or><D:not-
> is-collection/></D:and></D:where>
> <D:orderby><D:order><D:prop><D:getlastmodified/></
> D:prop><D:descending/></D:order></D:orderby>
> <D:limit><D:nresults>5</D:nresults></D:limit>
> </D:basicsearch></D:searchrequest>
>
> Any ideas or fixes?
>
> Best Regards
>
> Eirikur S. Hrafnsson, eiki@idega.is
> Chief Software Engineer
> Idega Software
> http://www.idega.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>