Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Sorting KinoSearch results

by moritz (Cardinal)
on Jun 19, 2008 at 10:04 UTC ( [id://692880]=perlquestion: print w/replies, xml ) Need Help??

moritz has asked for the wisdom of the Perl Monks concerning the following question:

I'm about to use the excellent KinoSearch module for a few non-standard tasks, for example for searching in IRC logs and SVN commit messages.

Both are "non-standard" in that it doesn't make sense to order the results by match quality, chronologically ordered results are much more useful (at least optionally).

Of course I could retrieve the results normally, sort them all, and re-implement the paging of results manually, but that's rather inefficient and clumsy.

Can I tell KinoSearch somehow to sort the result set by user-defined criteria? I know these criteria at indexing time (and even index creation time, if that helps).

grep'ping for sort seems promising, but so far I couldn't find documentation on how to do it.

Replies are listed 'Best First'.
Re: Sorting KinoSearch results
by jds17 (Pilgrim) on Jun 19, 2008 at 11:51 UTC
    I did not hear about this module before, looks very interesting. I read some of the documentation and came across KinoSearch::Search::SortSpec, which can be used to define altrnative sort orders. Seems like this could help you.
      Thanks, that seem to do the trick. Now I have to convince SVN::Log::Index to actually use it, either by patching or subclassing.

        Please note that SortSpec is available in the 0.20_xx devel branch of KinoSearch but not the stable 0.1x branch. While you should be able to use the devel branch on systems that you control, submitting a patch for SVN::Log::Index would be problematic: unfortunately, adding features such as SortSpec to KS necessitated changing both the file format and the API in ways that are not backwards compatible.

        When the KS devel branch approaches release maturity, I'm willing to work in conjunction with CPAN authors who have distros with KinoSearch as a dependency to update their modules. Patching for the current devel release probably wouldn't make sense though, because the KS file format and API are still unstable. (As for release schedule, I never issue time estimates unless somebody's paying me :) -- but FWIW I am working on KS full time right now.)

        --
        Marvin Humphrey
        Rectangular Research ― http://www.rectangular.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://692880]
Approved by GrandFather
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2026-01-18 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (122 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.