Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#2707 closed defect (fixed)

[patch] Backend for Xapian working in branche search-api

Reported by: sdm@… Owned by: Adrian Holovaty
Component: Contrib apps Version:
Severity: normal Keywords: search-api xapian
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Note that this does not implement the sortFields yet, I'm working in it.

Attachments (6)

patch1.diff (2.4 KB ) - added by sdm@… 18 years ago.
Patch for Xapian
xapian.py.patch (2.3 KB ) - added by sdm@… 18 years ago.
New version of Xapian backend (need query.py.patch)
query.py.patch (710 bytes ) - added by sdm@… 18 years ago.
New version of Hit class
patch2.diff (6.1 KB ) - added by sdm@… 18 years ago.
patch3.diff (6.4 KB ) - added by sdm@… 18 years ago.
Final (?) version
patch4.diff (7.0 KB ) - added by sdm@… 17 years ago.

Download all attachments as: .zip

Change History (10)

by sdm@…, 18 years ago

Attachment: patch1.diff added

Patch for Xapian

by sdm@…, 18 years ago

Attachment: xapian.py.patch added

New version of Xapian backend (need query.py.patch)

by sdm@…, 18 years ago

Attachment: query.py.patch added

New version of Hit class

comment:1 by sdm@…, 18 years ago

Done:

  • Added 2 news patch for query.py and xapian.py
  • In the query.py you can now just execute the ".get_object" and it will return the respective object for the result
  • Changed the __repr__ of Hit class to be more readable

TODO:

  • Better documentation in the code
  • Put the order_by argument to work
  • [Future] Remote backend functionalities?

comment:2 by anonymous, 18 years ago

Now I'm posting a big patch for 4 files (xapian.py, base.py, lucene.py, query.py)
Done:

  • Now the order_by works to Xapian
  • Was need edit the Lucene, I need that someone try it, I can't

Todo:

  • Put filters like "user:django" to work

by sdm@…, 18 years ago

Attachment: patch2.diff added

by sdm@…, 18 years ago

Attachment: patch3.diff added

Final (?) version

comment:3 by sdm@…, 18 years ago

Resolution: fixed
Status: newclosed

I've finished my work for now.

The Xapian backend are working with the following features:

  • order_by
  • Prefixes (like title:django)
  • Support for functions instead fields (needed when you need index "caminhao" instead "caminhão")
  • Return the object of a Hit when "get_object()" is called

WARNING

  • The version 0.3 of xapwrap (actualy the most recent - 2006-09-14) is BUGGED for newers versions of Xapian, it uses the "set_prefix" for QueryParser object, but the real function is "add_prefix", so you need edit the file "xapwrap/index.py" in the root of source code, go to the line 528 and change it, after (re)install the xapwrap and everything will be cool ;D
  • This still untested for Lucene and Hype, so please, someone test it

Well...is it...I hope that every body enjoy ;)

comment:4 by sdm@…, 17 years ago

Patch 4 added

Now I applied the getitem and getslice to allow easy access when used for web pages (page-based results)

Note: this patch is applied above the revision #3841

by sdm@…, 17 years ago

Attachment: patch4.diff added
Note: See TracTickets for help on using tickets.
Back to Top