[Xapian-discuss] Using synonyms and order of results

Websuche :: Felix Antonius Wilhelm Ostmann ostmann at websuche.de
Fri Feb 3 10:10:15 GMT 2012


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.



More information about the Xapian-discuss mailing list