Re: Grouping results in Zend Lucene Search

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Grouping results in Zend Lucene Search

Ajit Kulkarni
Hi,

I am using "Zend Lucene Search" for searching purpose. I have Lucene Index
built, where I am storing Username, Email, FirstName etc.I have autocomplete
input field.whenever user types in, I need to display the search results
categorywise. Is there any way to do that?

Is there any function in lucene, which determines which field matched the
term(search_string) passed? (In the above case I should know whether it
matched username or email or firstname).

structure of search result should be something similar to this.

By UserName
-uname1
-uname2
By Email
-uname1
-uname2
-uname3
-By_FirstName
-uname1
-fname2


Help appreciated!!!

Thx in Advance.
Reply | Threaded
Open this post in threaded view
|

Re: Grouping results in Zend Lucene Search

Hector Virgen
I'm not sure if there's a method like you mentioned (have you checked the
API docs?) But you might be able to accomplish this by doing three separate
searches.

Also, have you considered the possibility that a search term might match
more than one field? For example, a search for "john" might return the user
name "john" who also has "john" as his first name. In that case he would
appear in two categories. How you plan on tackling that problem (if it's a
problem at all) might affect how you go about implementing this.

--
Hector Virgen
Sent from my Droid X
--
Hector Virgen