query

Hi everybody,

I make a query like:
News[matainfo/@ownerid=5 or matainfo/@ownerid=12 or matainfo/@ownerid=1].
The response from Tamino is returned with “ino:id” order.
Is it possible to arrange this result with the same order required ?

regards
Cristian

Hi Cristian,

you can order the results using “sortby” - check the documentation of your Tamino version for exact details.

Hope that helps,
Trevor.

> Hi everybody,
> I make a query like:
> News[matainfo/@ownerid=5 or
> matainfo/@ownerid=12 or matainfo/@ownerid=1].
> The response from Tamino is returned
> with “ino:id” order.
> Is it possible to arrange this result with the
> same order required ?
>
> regards
> Cristian

Hi all,

My problem is not to order the result in asc sequence or desc sequence but in mixed order.
If I make this query :
News [(metainfo/@id=83) or (metainfo/@id=45) or (metainfo/@id=21)]
I would like to obtain the result in the same order.
On the contrary using the sortby clause I need to arrange the result in asc or desc sequence and not working with sortby clause the Tamino answer is properly returned with @ino:id order.

Maybe do you have any suggestions ?
Is it not possible using X-Path ?

Thank you in advance

Hi.

You want the result document ordered like you mentioned conditions in the query. For response time optimisations databases are allowed to list records in any order unless instructed otherwise. So you need to give the right sortby statement.

But you might test something else (I don’t know if this works):
Use several queries and have Tamino glue the responses together. This time the statement should look like this:

_xql=/News[matainfo/@ownerid=5] | /News[matainfo/@ownerid=12] | /News[matainfo/@ownerid=1]

Hiran

This will still return the documents ordered by ino:id because of the same optimization reasons.

So you either query documents separately or sort them yourself.