sort by index id descending?

View: New views
9 Messages — Rating Filter:   Alert me  

sort by index id descending?

by Jae Joo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there any way to sort by index id - descending? (by order of indexed)

Thanks,
Jae

Re: sort by index id descending?

by Jae Joo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Finding the way how to sort by internal_docid desc.

Thanks,
Jae

On Tue, Mar 18, 2008 at 11:41 AM, Jae Joo <jaejoo@...> wrote:

> Is there any way to sort by index id - descending? (by order of indexed)
>
> Thanks,
> Jae
>

Re: sort by index id descending?

by hossman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


: Is there any way to sort by index id - descending? (by order of indexed)

Not that i can think of.  Lucene already has support for it, so it would
probably be a fairly simple patch if someone wanted to try to implement
it, we just need some syntax to make the parameter parsing construct the
right Sort object -- allthough I'm loath to add another "magic" field name
like "score" since "docid" or "id" or anything else we can think of could
easily conflict with a field name in someones schema.

if we add something like this I'd want to add configuration to
solrconfig.xml to determine what the "magic" field names for sorting by
internal id and score should be.


-Hoss


Re: sort by index id descending?

by Erik Hatcher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wouldn't it sort by index id if you query for *:* and move any actual  
queries to fq parameters?

        Erik

On Mar 19, 2008, at 12:00 AM, Chris Hostetter wrote:

>
> : Is there any way to sort by index id - descending? (by order of  
> indexed)
>
> Not that i can think of.  Lucene already has support for it, so it  
> would
> probably be a fairly simple patch if someone wanted to try to  
> implement
> it, we just need some syntax to make the parameter parsing  
> construct the
> right Sort object -- allthough I'm loath to add another "magic"  
> field name
> like "score" since "docid" or "id" or anything else we can think of  
> could
> easily conflict with a field name in someones schema.
>
> if we add something like this I'd want to add configuration to
> solrconfig.xml to determine what the "magic" field names for  
> sorting by
> internal id and score should be.
>
>
> -Hoss


Re: sort by index id descending?

by Erik Hatcher-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oops, nevermind.... you said _descending_.

However, you can configure a timestamp field and sort by that:


     <field name="timestamp" type="date" indexed="true" stored="true"  
default="NOW" multiValued="false"/>

        Erik


On Mar 19, 2008, at 8:29 AM, Erik Hatcher wrote:

> Wouldn't it sort by index id if you query for *:* and move any  
> actual queries to fq parameters?
>
> Erik
>
> On Mar 19, 2008, at 12:00 AM, Chris Hostetter wrote:
>>
>> : Is there any way to sort by index id - descending? (by order of  
>> indexed)
>>
>> Not that i can think of.  Lucene already has support for it, so it  
>> would
>> probably be a fairly simple patch if someone wanted to try to  
>> implement
>> it, we just need some syntax to make the parameter parsing  
>> construct the
>> right Sort object -- allthough I'm loath to add another "magic"  
>> field name
>> like "score" since "docid" or "id" or anything else we can think  
>> of could
>> easily conflict with a field name in someones schema.
>>
>> if we add something like this I'd want to add configuration to
>> solrconfig.xml to determine what the "magic" field names for  
>> sorting by
>> internal id and score should be.
>>
>>
>> -Hoss
>


RE: sort by index id descending?

by Lance Norskog :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

... another "magic" field name like "score" ...

This could be done with a separate "magic" punctuation like $score,
$mean (the mean score), etc.so $docid would work.

Cheers,

Lance

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@...]
Sent: Tuesday, March 18, 2008 9:01 PM
To: solr-user
Subject: Re: sort by index id descending?


: Is there any way to sort by index id - descending? (by order of
indexed)

Not that i can think of.  Lucene already has support for it, so it would
probably be a fairly simple patch if someone wanted to try to implement
it, we just need some syntax to make the parameter parsing construct the
right Sort object -- allthough I'm loath to add another "magic" field
name like "score" since "docid" or "id" or anything else we can think of
could easily conflict with a field name in someones schema.

if we add something like this I'd want to add configuration to
solrconfig.xml to determine what the "magic" field names for sorting by
internal id and score should be.


-Hoss


RE: sort by index id descending?

by hossman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

: ... another "magic" field name like "score" ...
:
: This could be done with a separate "magic" punctuation like $score,
: $mean (the mean score), etc.so $docid would work.

"$" (and all other punctuation) is a legal character in field names ...
whitespace is even legal in fieldnames, but some of the code that parses
field names out of params can't handle it.

this is one of the "related issues" behind this proposal...

http://wiki.apache.org/solr/FieldAliasesAndGlobsInParams



-Hoss


Re: sort by index id descending?

by hossman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


: Oops, nevermind.... you said _descending_.
:
: However, you can configure a timestamp field and sort by that:

for the record: this wouldn't be quite as effecient as if we had a true
sort by internal id option (which would not need to build up a FieldCache)



-Hoss


RE: sort by index id descending?

by Lance Norskog-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

... another "magic" field name like "score" ...

This could be done with a separate "magic" punctuation like $score, $mean
(the mean score), etc.so $docid would work.


Cheers,

Lance

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@...]
Sent: Tuesday, March 18, 2008 9:01 PM
To: solr-user
Subject: Re: sort by index id descending?


: Is there any way to sort by index id - descending? (by order of
indexed)

Not that i can think of.  Lucene already has support for it, so it would
probably be a fairly simple patch if someone wanted to try to implement
it, we just need some syntax to make the parameter parsing construct the
right Sort object -- allthough I'm loath to add another "magic" field
name like "score" since "docid" or "id" or anything else we can think of
could easily conflict with a field name in someones schema.

if we add something like this I'd want to add configuration to
solrconfig.xml to determine what the "magic" field names for sorting by
internal id and score should be.


-Hoss