search for: sortable_serialise

Displaying 13 results from an estimated 13 matches for "sortable_serialise".

Did you mean: sortable_unserialise
2024 Apr 26
1
queries for a set of values
...could just OP_OR against the whole set. IOW, this is what notmuch does with terms: std::set<std::string> terms; // notmuch populates terms via terms.insert(*i)... Query(OP_OR, terms.begin(), terms.end()); // Disclaimer: I don't really know C++ With a set of integers I have (after sortable_serialise), would the best way be to OP_OR a bunch of OP_VALUE_RANGE queries together? So, perhaps something like: Query(OP_OR, Query(OP_VALUE_RANGE, column, v[0], v[0]), Query(OP_VALUE_RANGE, column, v[1], v[2]), Query(OP_VALUE_RANGE, column, v[3], v[3]), ... Query(OP_VALUE_RANGE, column, v[LAS...
2017 Sep 12
2
perl bindings to Xapian::Query
QueryParser is great, but I would like to make a query myself, so I can filter results by a specified value (in this case restricting by epoch time after a certain value) My code looks like this, and compiles, and appears like it should work according to the perl source:     my $query = $qp->parse_query($querystr);     if ($datefilter) {         my $filterepoch = time() - ($datefilter
2011 Aug 09
3
what is the fastest way to fetch results which are sorted by timestamp ?
what is the fastest way to fetch results which are sorted by timestamp ? i want to use xapian as my search engine , use add_boolean_term(something) and add_value(0,sortable_serialise(get_timestamp())) to a doc. search through enquire.set_weighting_scheme(xapian.BoolWeight()) and enquire.set_sort_by_value(0,True) to ensure that the results are sorted by the timestamp. This method is ok , but is there a faster way to do that ? Since i have millions of records .
2017 Sep 12
0
perl bindings to Xapian::Query
...hen you won't in general get the correct filtering - for example, "100" < "99". I'd suggest formatting as a fixed width string value (left padded with zeros or spaces) or packing into a big-endian binary value (e.g. pack("N", $filterepoch)) or using Xapian::sortable_serialise(). Xapian::sortable_serialise() is particularly useful with floating point values, but even with integers it produces fairly compact output (much better than a fixed width string). > I should say that I am using xapian-bindings-1.4.4 which I compiled and > installed myself. In case you mis...
2024 Apr 26
3
queries for a set of values
...can just always apply it: query = Xapian::Query(OP_FILTER, query, filter); The notmuch way will match nothing for that case so you need to conditionalise applying the filter (assuming you still want to match something when there are no filter terms). > With a set of integers I have (after sortable_serialise), would the > best way be to OP_OR a bunch of OP_VALUE_RANGE queries together? > > So, perhaps something like: > > Query(OP_OR, > Query(OP_VALUE_RANGE, column, v[0], v[0]), > Query(OP_VALUE_RANGE, column, v[1], v[2]), Did you mean 1 and 1 here? > Query(OP_VALUE_RA...
2017 Dec 15
5
How to get the serialise score returned in Xapian::KeyMaker->operator().
...ian::KeyMaker->operator(). But how can I get the serialise score in Xapian::MSetIterator object. c++ code likes this: class SortKeyMaker : public Xapian::KeyMaker { std::string operator()(const Xapian::Document& doc) const { double score = self-defined-function(doc); return Xapian::sortable_serialise(score); // How get this value in Xapian::MSetIterator } -- 发自我的网易邮箱手机智能版
2010 May 22
1
How to search documents with certain values
Hi all, I am creating Xapian documents and adding a unix timestamp to each document as a value using the doc.add_value method. When I search my Xapian database, I want the option to only search documents with a timestamp within the last year. Is there a way to search across documents with a value greater than a specified value string? Or is there a better way of doing something like this? Any
2017 Dec 16
0
How to get the serialise score returned in Xapian::KeyMaker->operator().
...n I get the serialise score > in Xapian::MSetIterator object. > > c++ code likes this: > > class SortKeyMaker : public Xapian::KeyMaker { > std::string operator()(const Xapian::Document& doc) const { > double score = self-defined-function(doc); > return Xapian::sortable_serialise(score); // How get this value in Xapian::MSetIterator > } Unfortunately the sort key isn't currently exposed via the public API. It's available internally and it seems like it ought to be accessible but there's no accessor method for it - I can add one but that won't help for...
2014 Mar 26
3
about sort_by_value
Hello, I have found that the use of sort_by_value very slow. 16800 result, return to the previous 10, sorting takes about 25ms. And if you do not sort, returns 10, need only about 0.3ms. How to make the sort faster? -------------- next part -------------- An HTML attachment was scrubbed... URL:
2018 Mar 30
2
sorting large msets
...1, TMPDIR => 1); my $flag = Search::Xapian::DB_CREATE_OR_OPEN; my $xdb = Search::Xapian::WritableDatabase->new($tmp, $flag); my $n = shift || 100; for my $i (0..$n) { $xdb->begin_transaction; for my $j (0..2000) { my $doc = Search::Xapian::Document->new; my $num = Search::Xapian::sortable_serialise(($i * 1000) + $j); $doc->add_value(0, $num); $doc->set_data("$i $j"); $doc->add_boolean_term('T' . 'mail'); $xdb->add_document($doc); $doc = Search::Xapian::Document->new; $doc->add_value(0, $num); $doc->set_data("$i $j"); $d...
2008 Sep 09
3
sort by value fails
hi all, i want use sort_by_value to sort by "username". so in the indexing process i add the value i want sort by as value (lang is php) $document->add_value(0, 'value'); when i sort i got all specialchars at the beginning ? ? ? alf the values be indexed as utf8. what do i wrong? any suggestions? regards, sven
2011 Aug 11
3
Fwd: Re: what is the fastest way to fetch results which are sorted by timestamp ?
...very awkward to get an index in such order though, > > particularly in the face of updates, assuming that you want the sort > > order to show most recent first. > > > > > i want to use xapian as my search engine , use > add_boolean_term(something) and > add_value(0,sortable_serialise(get_timestamp())) to a doc. > > > search through enquire.set_weighting_scheme(xapian.BoolWeight()) and > enquire.set_sort_by_value(0,True) to ensure that the results are sorted by > the timestamp. > > > > That's another approach, certainly. > > > > > Th...
2015 Nov 14
1
Xapian-Haystack is available in Python 3
Hi, I'm the current developer of Xapian-Haystack, and I'm glad to announce that we've been finally able to install and pass all the tests of Xapian-Haystack with Xapian 1.3.3 in both Python 2 and 3, which means that Xapian-Haystack now supports Python 3. This naturally would not be possible without your efforts to push Xapian bindings to Python 3, and I thank you for that. Here I