Opened 14 years ago
Closed 13 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)
Change History (6)
by , 14 years ago
Attachment: | 2ORchanges.patch added |
---|
comment:1 by , 14 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 , 14 years ago
Cc: | added |
---|
comment:3 by , 14 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).
These are 2 changes to change OR to AND operation.