You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by faizal abdoelrahman <fa...@yahoo.com> on 2003/09/05 11:06:06 UTC

boolean and query through multiple fields

Hi,


I have n terms in my query and I want each term to
match content from a field, but not necessarily within
a field.

Example fields: manufacturer, description
.Now I want to search for the terms "red" "ford" in
any of these fields, but each term should match some
field.


Solutions I came up with but are really not
satisfactory:
- permute query 
  (+manufacturer:red  +description:ford) or
(+manufacturer:ford +description:red)
  rejected because the number of combinations grows
very large with many fields and many search terms
- concatenating the contents of these selected fields
into one field doing "+concat_field:ford
+concat_field:red".
  This works but now I loose all the advantages of a
multifield index.

Hopefully one of you can help me out or point me to
lucene api sections which I can extend to achieve this
 effect.

Faizal Abdoelrahman
Amsterdam






__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: boolean and query through multiple fields

Posted by faizal abdoelrahman <fa...@yahoo.com>.
Only at run-time we know which fields to search
through. 
(The static index contains some 80 fields, of which on

average 5 fields are searched for, but this set can 
differ per day)

This means updating the concatenated field
when the set of searchable fields changes (daily)?
Is there a way to do this efficiently with a lucene
index, building a field based on the contents of other
fields?

Otherwise I will just make the concatenated field when

I build the index (making the index less static, coz
then it will be updated daily) and
people will have to live with that...

Faizal


--- Erik Hatcher <er...@ehatchersolutions.com> wrote:
> On Friday, September 5, 2003, at 05:06  AM, faizal
> abdoelrahman wrote:
> > - concatenating the contents of these selected
> fields
> > into one field doing "+concat_field:ford
> > +concat_field:red".
> >   This works but now I loose all the advantages of
> a
> > multifield index.
> 
> You don't really lose any multifield advantages -
> keep the other fields 
> *and* the concatenated one.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: boolean and query through multiple fields

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Friday, September 5, 2003, at 05:06  AM, faizal abdoelrahman wrote:
> - concatenating the contents of these selected fields
> into one field doing "+concat_field:ford
> +concat_field:red".
>   This works but now I loose all the advantages of a
> multifield index.

You don't really lose any multifield advantages - keep the other fields 
*and* the concatenated one.