Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2707 closed defect (fixed)

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

Reported by: sdm@… Owned by: adrian
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: UI/UX:

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@… 8 years ago.
Patch for Xapian
xapian.py.patch (2.3 KB) - added by sdm@… 8 years ago.
New version of Xapian backend (need query.py.patch)
query.py.patch (710 bytes) - added by sdm@… 8 years ago.
New version of Hit class
patch2.diff (6.1 KB) - added by sdm@… 8 years ago.
patch3.diff (6.4 KB) - added by sdm@… 8 years ago.
Final (?) version
patch4.diff (7.0 KB) - added by sdm@… 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by sdm@…

Patch for Xapian

Changed 8 years ago by sdm@…

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

Changed 8 years ago by sdm@…

New version of Hit class

comment:1 Changed 8 years ago by sdm@…

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 Changed 8 years ago by anonymous

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

Changed 8 years ago by sdm@…

Changed 8 years ago by sdm@…

Final (?) version

comment:3 Changed 8 years ago by sdm@…

  • Resolution set to fixed
  • Status changed from new to closed

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 Changed 8 years ago by sdm@…

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

Changed 8 years ago by sdm@…

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.