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.
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
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.