lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject RE: Search for a term in all fields
Date Wed, 21 Feb 2007 21:24:41 GMT

: Well, here's my current thoughts on acheiveing this.  Instead of putting
: a 1000 space gap between elements of the 1ll field could I not use a
: character that isn't used in the data such as ~ and then somehow (don't
: know how) use that to search all fields?

you could certianly introduce an artifical token into the stream, and then
use a SpanNotQuery to ensure that SpanNearQueries don't cross that
artificial token -- but it doesn't get arround the fact that you need to
add all of your text to a single ield ... that's not the same as "search
all field" (you have to be very clear about your terminology, if you
really ant to "search all fields" you need a boolean query across all
fields -- if you want to "search all text" then you haveto put "all text"
into a single field)

the real question you have to ask is why do you think a special character
would be better then a positionIncrimentGap? ... adding the gap is free,
easy to do, doesn't affect your index size at all, and doesn't require any
special parsing or index knowledge at query time -- just do phrase queries
as normal with moderate slop.

searching the archive for "sentence boundary" will find you some
justifications as to why you might want special marker terms in your data
to query on if you are trying to do searhes confined to a single
page/paragrpah/sentence/etc...  but if you don't have special needsl ike
that, a position gap is trivial and logical.



-Hoss


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


Mime
View raw message