473,765 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python 2.5 + sqlite full text search possible?

Hi!

Is it possible to use the full-text module of SQLite with the sqlite3
module? I've done a bit of investigation and it seems the stand-alone
distribution of SQLite is compiled without it, and so does the version
bundled with Python.

Regards,

Guillermo
Oct 28 '08 #1
2 3173
On 10/28/08, Guillermo <gu************ **@googlemail.c omwrote:
Hi!

Is it possible to use the full-text module of SQLite with the sqlite3
module? I've done a bit of investigation and it seems the stand-alone
distribution of SQLite is compiled without it, and so does the version
bundled with Python.
Support for loading extensions was only added in pysqlite 2.5, so you
will have to install it.

Python 2.5 and 2.6 comes with pysqlite 2.3.2, future 3.0 will come
with pysqlite 2.4.1.

Regards,

Guillermo

--
http://mail.python.org/mailman/listinfo/python-list

--
-- Guilherme H. Polo Goncalves
Oct 28 '08 #2
Guillermo wrote:
Hi!

Is it possible to use the full-text module of SQLite with the sqlite3
module? I've done a bit of investigation and it seems the stand-alone
distribution of SQLite is compiled without it,
Yes, though compiling using the amalgamation and defining
SQLITE_ENABLE_F TS3 helps.
and so does the version bundled with Python.
True.

I'm too lazy to build a SQLite3 DLL with FTS enabled, I'm pretty sure
those can be found on the net.

But I've just patched pysqlite with one line:

+ ext.define_macr os.append(("SQL ITE_ENABLE_FTS3 ", "1")) #
build with fulltext search enabled

which helped its super-crazy script mkwin32.py to build Windows binaries
*on Linux* that fetch the SQLite amalgamation and build Windows
binaries for Python 2.3, 2.4 and 2.5 (no 2.6, yet).

Just go here
http://oss.itsystementwicklung.de/do...5.0/win32_fts/

download and install the binary for Python 2.5 and off you go:
from pysqlite2 import dbapi2 as sqlite3

con = sqlite3.connect (":memory:")

# example from SQLite wiki
con.execute("cr eate virtual table recipe using fts3(name, ingredients)")
con.executescri pt("""
insert into recipe (name, ingredients) values ('broccoli stew', 'broccoli peppers cheese tomatoes');
insert into recipe (name, ingredients) values ('pumpkin stew', 'pumpkin onions garlic celery');
insert into recipe (name, ingredients) values ('broccoli pie', 'broccoli cheese onions flour');
insert into recipe (name, ingredients) values ('pumpkin pie', 'pumpkin sugar flour butter');
""")
for row in con.execute("se lect rowid, name, ingredients from recipe where name match 'pie'"):
print row
-- Gerhard
Oct 28 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3769
by: Kenneth McDonald | last post by:
I'm looking for a Wiki engine to set up for my company, so that we can incrementally add user documentation for a fairly complex program, plus allow users to add their own comments for the benefit of others. I'd strongly prefer a Python-based Wiki, since that allows me the chance to add plugins with minimal effort (being a python enthusiast and programmer). However, I'd also like something that can provide a little more structure than...
1
2579
by: David Fowler | last post by:
I'm new to getting in touch with other PHP users/PHP team, so please excuse me if this post is at all inappropriate or in the wrong place. In the current release of PHP (5.1.4) and in the CVS for PHP5.1.* and 5.2.* the SQLite source version only stands at 3.2.8, while the actual realease is now at 3.3.6. What I was wondering is whether or not this could be updated, as there have been numerous bug fixes in the SQLite source in the past 6...
0
977
by: python | last post by:
Does Python 2.5.2's embedded SQLite support full text searching? Any recommendations on a source where one can find out which SQLite features are enabled/disabled in each release of Python? I'm trying to figure out what's available in 2.5.2 as well as what to expect in 2.6 and 3.0. Thank you, Malcolm
3
275
by: Daniel Fetchinson | last post by:
Does Python 2.5.2's embedded SQLite support full text searching? Sqlite itself is not distributed with python. Only a python db api compliant wrapper is part of the python stdlib and as such it is completely independent of the sqlite build. In other words, if your sqlite build supports full text searching you can use it through the python sqlite wrapper (that is part of the stdlib) and if it doesn't then not. This is true for any sqlite...
2
3932
by: Joe Goldthwaite | last post by:
I'm confused. (Not a new experience). I've got a web application running under Zope. I use the Wing IDE for testing and debugging. When trying to recreate problems that come up on the web, I wrote some little routines that pull my cookies out of the Firefox cookies.txt file into my code. That way, I'm working with all the same options under Wing that my app uses when running under Zope. That's worked great until I upgraded to Firefox...
0
2573
by: Joe Goldthwaite | last post by:
Thanks Guilherme. That helped. I guess I was thinking that pysqlite would automatically come with some version of sqlite. The fact that it doesn't is what was causing me to get the strange results. I downloaded the Windows version of the SQLite3.dll. I didn't know where to put it so I first put it in its own directory and tried to register it. That didn't work so I just moved it to the pysqlite directory in site-packages. That did...
1
328
by: Guillermo | last post by:
Hi! Is it possible to load the full-text search module for the SQLite version bundled with Python 2.5? I've tested it and the stand-alone SQLite distribution doesn't seem to include it (sqlite.load fts2), nor does Python. I'm on Windows XP.
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.