Jim Lynch
2012-Jan-20 11:02 UTC
[Xapian-discuss] Perl version of sortable_serialize missing?
I attempted to use the sortable_serialize function from perl, however doesn't seem to exist. The only occurrence of the string "sortable" in the /usr/local/perl/5.10.1/Search/ tree is in the pod in Xapian.pm. What am I doing wrong? use Search::Xapian; ... $doc->add_value(4,sortable_serialize($recdate)); Undefined subroutine &main::sortable_serialize called at newgenstaticindex line 444 Thanks, Jim.
Olly Betts
2012-Jan-21 01:21 UTC
[Xapian-discuss] Perl version of sortable_serialize missing?
On Fri, Jan 20, 2012 at 06:02:13AM -0500, Jim Lynch wrote:> I attempted to use the sortable_serialize function from perl, however > doesn't seem to exist. The only occurrence of the string "sortable" in > the /usr/local/perl/5.10.1/Search/ tree is in the pod in Xapian.pm.It's wrapped entirely in XS, so the wrapper is in the compiled Xapian.so shared object.> What am I doing wrong? > > use Search::Xapian; > ... > $doc->add_value(4,sortable_serialize($recdate));It isn't exported into the global namespace, so you need to explicitly qualify its name: $doc->add_value(4,Search::Xapian::sortable_serialize($recdate)); Cheers, Olly
Websuche :: Felix Antonius Wilhelm Ostmann
2012-Feb-03 10:10 UTC
[Xapian-discuss] Using synonyms and order of results
I found a simple solution by using OP_AND_MAYBE and OP_SCALE_WEIGHT! The new query: [QUERY: Xapian::Query((0.5 * ((Zstempel:(pos=1) SYNONYM Zamtszeich:(pos=1) SYNONYM Zgrubenholz:(pos=1) SYNONYM Zkennzeich:(pos=1) SYNONYM Zpoststempel:(pos=1) SYNONYM Zpragestempel:(pos=1) SYNONYM Zpunz:(pos=1) SYNONYM Zsiegel:(pos=1)) FILTER QMde) AND_MAYBE Zstempel:(pos=1)))] It also works with multiple terms. Again, xapian is simple and fast! Am 30.01.2012 10:28, schrieb Websuche :: Felix Antonius Wilhelm Ostmann:> We are using FLAG_AUTO_SYNONYMS and it works like a charm (+stemmer), > but we currently have a problem with the order of the results. We think, > the best result will be a result without a synoym. > > We search for stempel (german for chop) and after FLAG_AUTO_SYNONYMS > (+STEM_SOME as stemming strategy) we get the following query: > > [QUERY: Xapian::Query(((Zstempel:(pos=1) SYNONYM Zamtszeich:(pos=1) > SYNONYM Zgrubenholz:(pos=1) SYNONYM Zkennzeich:(pos=1) SYNONYM > Zpoststempel:(pos=1) SYNONYM Zpragestempel:(pos=1) SYNONYM Zpunz:(pos=1) > SYNONYM Zsiegel:(pos=1)) FILTER QMde))] > > [POS: 0] [PERCENT: 100%] [WEIGHT:10.153175] [ID: 64977] [PID: 8876897] > ... > [POS: 38] [PERCENT: 100%] [WEIGHT:8.763471] [ID: 125701] [PID: 9023761] > ... > > Term List for record #64977: QMde QMint Zpunz punzen > Term List for record #125701: QMde QMint Zstempel Zstempelkiss Zstempeln > stempel stempelkissen stempeln > > > Perhaps there is a solution by building a special search or two searches > (first without synonym, second with), but the problem starts, when there > are 3.. terms to search for, all with synoynms. > > Is there a way to prefer results with exact hits? > > _______________________________________________ > Xapian-discuss mailing list > Xapian-discuss at lists.xapian.org > http://lists.xapian.org/mailman/listinfo/xapian-discuss >-- Mit freundlichen Gr??en Felix Antonius Wilhelm Ostmann ----------------------------------------------------------- Websuche Search Technology GmbH & Co. KG Martinistra?e 3, D-49080 Osnabr?ck ----------------------------------------------------------- Tel.: +49 (0) 541 40666 0, Fax: +49 (0) 541 40666 22 Email: info at websuche.de, Web: www.websuche.de ----------------------------------------------------------- HRA 200252, AG Osnabr?ck, Ust-IdNr.: DE814737310 ----------------------------------------------------------- Komplement?rin: Websuche Search Technology Verwaltungs GmbH HRB 200359, AG Osnabr?ck, Gesch?ftsf?hrer: Ansas Meyer ----------------------------------------------------------- Die in dieser Email enthaltenen Informationen sind vertrau- lich zu behandeln und ausschlie?lich f?r den Adressaten be- stimmt. Jegliche Ver?ffentlichung, Verteilung oder sonstige in diesem Zusammenhang stehende Handlung wird ausdr?cklich untersagt.