Opened 14 years ago

Closed 12 years ago

#512 closed defect (fixed)

Default operator for Omega

Reported by: Olly Betts Owned by: Olly Betts
Priority: normal Milestone: 1.3.0
Component: Omega Version: SVN trunk
Severity: normal Keywords:
Cc: nonijil@… Blocked By:
Blocking: Operating System: All

Description

Currently Omega defaults to OP_OR, but these days other search engines have trained users to expect an AND search by default.

I think we should consider changing the default for the next release series, so setting milestone to 1.3.0.

Attachments (2)

2ORchanges.patch (788 bytes ) - added by laserbled 13 years ago.
These are 2 changes to change OR to AND operation.
Docupdates-cgiparams.patch (601 bytes ) - added by laserbled 13 years ago.
Document updates

Download all attachments as: .zip

Change History (6)

by laserbled, 13 years ago

Attachment: 2ORchanges.patch added

These are 2 changes to change OR to AND operation.

comment:1 by laserbled, 13 years ago

filter_vec.push_back(Xapian::Query(Xapian::Query::OP_OR,

Xapian::Query::op default_op = Xapian::Query::OP_OR; default matching mode

hope those are the only required once....Am not sure what to do about the OR operations in xapian core and search stuffs.

comment:2 by laserbled, 13 years ago

Cc: nonijil@… added

comment:3 by Olly Betts, 13 years ago

Actually, only the first hunk of that patch is relevant here.

The second hunk is to do with how filters with the same prefix are combined (which ought to be configurable - see ticket #234 - but that's not the default operator for query parsing, it's about what happens with multiple B CGI parameters specifying filter terms with the same term prefix).

But if you build with your change, add $querydescription to the end of templates/query and then run a query, you'll see that while the default is now OP_AND, explicitly specifying DEFAULTOP=OR doesn't work:

olly@atreus:~/svn/xapian/xapian-applications/omega$ echo '$querydescription' >> templates/query
olly@atreus:~/svn/xapian/xapian-applications/omega$ OMEGA_CONFIG_FILE=omega.conf ./omega P='hello world' |tail -1
Xapian::Query((Zhello:(pos=1) AND Zworld:(pos=2)))
olly@atreus:~/svn/xapian/xapian-applications/omega$ OMEGA_CONFIG_FILE=omega.conf ./omega DEFAULTOP=OR P='hello world' |tail -1
Xapian::Query((Zhello:(pos=1) AND Zworld:(pos=2)))

We also need to change where default_op gets set from the DEFAULTOP CGI parameter, in omega.cc. And the documentation needs updating to reflect the new default too (ideally with a note that the default was OR in versions prior to 1.3.0, or whenever this gets applied).

by laserbled, 13 years ago

Attachment: Docupdates-cgiparams.patch added

Document updates

comment:4 by Olly Betts, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r16204.

Note: See TracTickets for help on using tickets.