Hi All,
Will u please give me some clue for searching on more than one field
of document.
My document has six field and i want to search on three fields.
Presently I am able to search on only TITLE field..
query = QueryParser.parse(queryString, "TITLE", analyzer);
Regards..
Amares
On Tue, 2006-06-06 at 14:38 +0530, Amaresh Kumar Yadav wrote:
> My document has six field and i want to search on three fields.
>
> Presently I am able to search on only TITLE field..
>
> query = QueryParser.parse(queryString, "TITLE", analyzer);
You want to use the MultiFieldQueryParser.
-
r Yadav [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 06, 2006 1:08 PM
To: java-user@lucene.apache.org
Subject: searching in more than fields on document
Hi All,
Will u please give me some clue for searching on more than one field
of document.
My document has six field and i want to search
I was wondering this exact question, but MultiFieldQueryParser still
requires you to specify the field names. In my application I don't know
the field names (they're automatically generated from beans using
BeanUtils.getProperties()), so I've resorted to concatenating all the
fields into a sing
On Tue, 2006-06-06 at 10:47 +0100, digby wrote:
> I was wondering this exact question, but MultiFieldQueryParser still
> requires you to specify the field names. In my application I don't know
> the field names (they're automatically generated from beans using
> BeanUtils.getProperties()), so I'
Not sure if I understand exactly what you want to do, but would the
":" syntax that QueryParser understands work for you? That
is, you could send query text like
f1:foo f2:foo f3:foo
to search for "foo" in any of the 3 fields. If you need boolean capabilities
you can use parentheses, li
Basically, I've got a small app which allows me to update fields in
bunch of mysql tables using Hibernate. As I save each bean, I'm want to
add it to the lucene index aswell. However, I want the app to be as
generic as possible and at the moment it doesn't care what the bean is,
as long as ther
All sorted now. Of course, if I can loop through the properties of a
bean to add them as fields to the document, then I can certainly do the
same at query time to build the MultiFieldQueryParser. All done and
working great.
Thanks for all your comments.
digby wrote:
Basically, I've got a smal