lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Rouhi <sro...@yahoo.com>
Subject Query across multiple fields scenario not handled by "MultiFieldQueryParser" (figured out how to do it)
Date Wed, 09 Jul 2003 18:54:04 GMT
Just a note to anyone interested, I figured out how to
solve to problem I posed last week by adding the
functionality needed to QueryParser.jj. It was a
pretty specialized request to begin with - but anyone
interested - I'll be glad to let them know how it
works.

Ali

--- Ali Rouhi <srouhi@yahoo.com> wrote:
> Hi
> 
> I need to perform a search for an expression in
> multiple fields "as if" they were one field. This is
> best illustrated by a simple example.
> 
> Find expression (X AND Y) in fields (F, G). 
> 
> I want this to translate to:
> 
> ((X in F) OR (X in G)) AND ((Y in F) OR (Y in G)) 
> 
> In other words I want the query to return true *not
> only* if
> 
> ((X AND Y) in F) OR ((X AND Y) in G)               
> (1)
> 
> but *also* the following should give me a true value
> 
> ((X in F) AND (Y in G)) OR ((X in G) AND (Y in F)) 
> (2)
> 
> I believe that "MultiFieldQueryParser" just gives me
> (1) and leaves out the "cross terms" in(2).(If you
> want a practical example of why one would want to do
> such a search I would be glad to provide one).
> 
> Of course I could construct the combination of (1)
> and
> (2) manually, but the problem is that I want the
> "general solution" with a general expression being
> searched for in multiple fields in the manner of the
> above example.
> 
> I have a feeling that this sort of a thing is best
> done by writing a custom QueryParser.jj. We use
> Lucene
> in production code and have great java expertise,
> but
> little JavaCC expertise. Suggestions for solving the
> problem at a higher level than the QueryParser are
> of
> course also very welcome.
> 
> Many Thanks
> Ali
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message