Google Groups Home
Help | Sign in
Search Functionality
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kevin  
View profile  
 More options Dec 28 2005, 4:25 pm
From: "Kevin" <kevinast...@gmail.com>
Date: Wed, 28 Dec 2005 13:25:15 -0800
Local: Wed, Dec 28 2005 4:25 pm
Subject: Search Functionality
Could anyone provide some hints on how they have implemented search
functionality on their web site?  Did you do it django or use another
middleware (eg, Lucene)?  If you did it django, did you bypass the ORM
and use direct SQL to take advantage of full text search?

I'm currently trying to build the functionality directly in django's
ORM as a cascade of functions that would retrieve matches in decreasing
relevance, eg:

class Article(meta.Model):
    title = meta.CharField()
    description = meta.TextField()
    keywords = meta.CharField()

def search(request, term):
    matches = []
    matches.extend(findExactTitle(term))
    matches.extend(findInTitle(term))
    matches.extend(findInKeywords(term))
    matches.extend(findInDescription(term))

    render_to_response('search_results', {'matches': matches}

Any ideas?  Suggestions?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Bennett  
View profile  
 More options Dec 28 2005, 4:58 pm
From: James Bennett <ubernost...@gmail.com>
Date: Wed, 28 Dec 2005 16:58:20 -0500
Local: Wed, Dec 28 2005 4:58 pm
Subject: Re: Search Functionality
On 12/28/05, Kevin <kevinast...@gmail.com> wrote:

> Could anyone provide some hints on how they have implemented search
> functionality on their web site?  Did you do it django or use another
> middleware (eg, Lucene)?  If you did it django, did you bypass the ORM
> and use direct SQL to take advantage of full text search?

You may want to give this a try:
https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/AbstractS...

I haven't yet had an opportunity to use it myself, but it seems to be
what you're looking for.

--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adrian Holovaty  
View profile  
 More options Dec 29 2005, 10:31 am
From: Adrian Holovaty <holov...@gmail.com>
Date: Thu, 29 Dec 2005 09:31:01 -0600
Local: Thurs, Dec 29 2005 10:31 am
Subject: Re: Search Functionality
On 12/28/05, Kevin <kevinast...@gmail.com> wrote:

> Could anyone provide some hints on how they have implemented search
> functionality on their web site?  Did you do it django or use another
> middleware (eg, Lucene)?  If you did it django, did you bypass the ORM
> and use direct SQL to take advantage of full text search?

Hey Kevin,

At World Online, the search engine (lawrence.com/search,
ljworld.com/search) uses swish-e (http://swish-e.org/) to index files.

We made a small script that reads a custom Django setting
(FULL_TEXT_INDEXING) to find out which models need to be indexed. The
indexer runs on a regular basis; for each to-be-indexed model, it
grabs all items in the system using get_list() (with optional limiting
kwargs designated in FULL_TEXT_INDEXING), renders each result in a
template according to its content type, and indexes the resulting
rendered template.

Then, when somebody does a search on the site, we use swish-e's Python
bindings to retrieve the IDs of the objects that match the search
criteria. Then we use Django's get_in_bulk() to retrieve the actual
objects. get_in_bulk() takes a list of IDs and returns a dictionary of
{id: object}. (Trivia: get_in_bulk() was created to solve this exact
problem.)

Hope that helps! It would be pretty cool to open-source this mini
search framework and pop it in django/contrib, but that would be up to
Jacob to decide.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Kaplan-Moss  
View profile  
 More options Dec 29 2005, 3:23 pm
From: Jacob Kaplan-Moss <ja...@jacobian.org>
Date: Thu, 29 Dec 2005 14:23:24 -0600
Local: Thurs, Dec 29 2005 3:23 pm
Subject: Re: Search Functionality
On Dec 29, 2005, at 9:31 AM, Adrian Holovaty wrote:

> At World Online, the search engine (lawrence.com/search,
> ljworld.com/search) uses swish-e (http://swish-e.org/) to index files.

[snip]

> Hope that helps! It would be pretty cool to open-source this mini
> search framework and pop it in django/contrib, but that would be up to
> Jacob to decide.

I'd love to open it up; I don't see any reason that we'd need to keep  
it hidden.  I'll put it on my todo list :)

Jacob


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pratt  
View profile  
 More options Dec 29 2005, 9:59 pm
From: David Pratt <fairwi...@eastlink.ca>
Date: Thu, 29 Dec 2005 22:59:55 -0400
Local: Thurs, Dec 29 2005 9:59 pm
Subject: Re: Search Functionality
Hi Jacob and Adrian.

Doesn't Swish-e pose an incompatibility for licensing? Everything Django
has been BSD up to this point and I would hate to see anything alter
this. Isn't swish-e gpl?

Regards,
David


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Tobin  
View profile  
 More options Dec 29 2005, 11:06 pm
From: Tom Tobin <korp...@gmail.com>
Date: Thu, 29 Dec 2005 23:06:12 -0500
Local: Thurs, Dec 29 2005 11:06 pm
Subject: Re: Search Functionality
On 12/29/05, David Pratt <fairwi...@eastlink.ca> wrote:

> Doesn't Swish-e pose an incompatibility for licensing? Everything Django
> has been BSD up to this point and I would hate to see anything alter
> this. Isn't swish-e gpl?

Swish-e grants a special exemption from automatically GPL'ing linked
programs which use the libswish-e API interface:

http://swish-e.org/license.html


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Kaplan-Moss  
View profile  
 More options Dec 30 2005, 12:05 am
From: Jacob Kaplan-Moss <ja...@jacobian.org>
Date: Thu, 29 Dec 2005 23:05:42 -0600
Local: Fri, Dec 30 2005 12:05 am
Subject: Re: Search Functionality
On Dec 29, 2005, at 10:06 PM, Tom Tobin wrote:

> On 12/29/05, David Pratt <fairwi...@eastlink.ca> wrote:
>> Doesn't Swish-e pose an incompatibility for licensing? Everything  
>> Django
>> has been BSD up to this point and I would hate to see anything alter
>> this. Isn't swish-e gpl?

> Swish-e grants a special exemption from automatically GPL'ing linked
> programs which use the libswish-e API interface:

> http://swish-e.org/license.htmll

Plus, this would be a contributed app -- or possible something  
distributed separately from Django -- that requires you to install  
Swish-E separately.  I don't see this being a core part of Django.

Seriously, though, this licensing stuff sucks :(

Jacob


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin  
View profile  
 More options Dec 31 2005, 10:33 pm
From: "Kevin" <kevinast...@gmail.com>
Date: Sat, 31 Dec 2005 19:33:19 -0800
Local: Sat, Dec 31 2005 10:33 pm
Subject: Re: Search Functionality
That would be great.  I think it would a strong benefit to many django
users as search is such a common problem.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google